Column Chart with Columns That Vary in Width

The subject is Column Chart with Columns That Vary in Width.
I have been concentrating on the column renderer. Unfortunately,
the renderer class receives control with access to limited
information. Mainly, what it gets is pixel counts that measure the
dimensions of the rectangle that ends up being a column. There is
no straightforward way to send width information to the renderer. I
can, however, change the color of the column. I thought of encoding
the width in the height, but that distorts the actual height,
potentially causing the chart scale to be computed incorrectly.
Also, the encoding is hard to reverse once the height in
transformed by an unknown and varying scale factor so that the
column fits on the chart. I love the way the column chart looks. I
only want to alter the width of each individual column. Since I am
drawing each column, if I knew the widths, I'd be done by now. Do
you have a better approach? Thanks in advance.

You need three ColumnSeries. Set the dataProvider of each directly (instead of setting it for the ColumnChart) to something like this:
  var cars:ListCollectionView = new ListCollectionView();
  cars.list = inventory;
  cars.filterFunction = function(item:Object):Boolean {
    return item['category' /* or whatever your category field is */] == 'cars';
Do something similar for bikes and trucks. You can do something like this if you don't know the number of categories as well, but it's rather trickier (and left as an exercise for the reader).

Similar Messages

  • Drill Down between 2 stacked column chart with multiple rows.

    Hi,
    Can anyone please help me.
    1) i have to create stacked column chart with Region and cout of calls for previous 3 quarters.
    2) the 2nd stacked column should display the priority with the count of calls for the respective selection of region on the 1st chart..
    to achieve this,
    i'm using 2 stacked column charts and 1 lebel baseb menu.
    from this i can able to get the drill down from label based menu to 2nd stacked column chart but i couldn't able to done the same from 1st stacked coumn chart.
    Becoz my data is multiple row for each quarter.
    please suggest me to achieve the drill down between 2 stacked column charts.
    assume that my data like below.:
    coulmns for 1st stacked column chart : Region, Q2,Q3 &Q4
    Region                Q2                Q3               Q4
    Other              3658              3497               497
    NA - North
    America                3               3               1101
    APJK     1     4     597
    UK               324
    EMEA North     1     1     288
    CORPORATE     1     5     215
    LA -
    Latin America1     2     208
    EMEA     1          199
    EMEA South     1     1     169
    Coulmns for 2nd coumn chart:  Region, Priority, Q2,Q3,Q4 ()which is derived from 1st table.
    Region     Priority     Q2     Q3     Q4
    Other     D: End of Next Day     1568     1613     239
    Other     C: End of Day     983     893     119
    Other     A: 2 Hour     631     610     70
    Other     B: 4 Hour     396     318     56
    NA -
    North AmericaD: End of Next Day     2     2     514
    APJK     D: End of Next Day          3     297
    NA -
    North AmericaC: End of Day               284
    NA -
    North AmericaA: 2 Hour     1          170
    UK     D: End of Next Day               157
    APJK     C: End of Day     1     1     152
    Other     E: 3 - 5 Business Days     68     58     13
    EMEA North     D: End of Next Day          1     136
    CORPORATE     D: End of Next Day          4     107
    NA - North America     B: 4 Hour          1     104
    LA - Latin America     D: End of Next Day     1     1     86
    EMEA     D: End of Next Day               86
    UK     C: End of Day               85
    APJK     A: 2 Hour               79
    EMEA South     D: End of Next Day               72
    EMEA North     A: 2 Hour               69
    EMEA North     C: End of Day               56
    APJK     B: 4 Hour               55
    EMEA     C: End of Day     1          53
    LA - Latin America     C: End of Day               54
    UK     A: 2 Hour               49
    EMEA South     C: End of Day     1          44
    CORPORATE     A: 2 Hour          1     43
    CORPORATE     C: End of Day               44
    LA - Latin America     A: 2 Hour          1     42
    EMEA South     A: 2 Hour          1     32
    EMEA     B: 4 Hour               30
    UK     B: 4 Hour               30
    EMEA     A: 2 Hour               27
    EMEA North     B: 4 Hour     1          26
    NA -
    North AmericaE: 3 - 5 Business Days               25
    LA - Latin America     B: 4 Hour               23
    EMEA South     B: 4 Hour               20
    CORPORATE     B: 4 Hour               17
    APJK     E: 3 - 5 Business Days               13
    Other     F: 6 - 10 Business Days     6     4     
    Other     G: 11 - 20 Business Days     6     1

    Hi Srinivas,
    I'm using label based menu "filterd rows" only but i couldn't bind the drill down with the 1st stacked column chart.
    for mor details:
    1) i'm having 2 stacked coumn charts & 1 lebel based menu but eventhough i couldn't able to achieve.
    if i select the lebel based values then the 2nd stacked column charts is giving detailed valus but if i keep my mouse on the 1st stacked column chart the there is no changes on the 2nd chart..
    somewhere i'm mising the binding data between 1st stacked coumn chart & lebel based menu on drill down part.
    Becoz i'm having multiple rows. so can you please try your and send me the xlf file using your concept.

  • Column chart with null data items

    I have a Column Chart with an ArrayCollection data provider.
    The data will sometimes have missing items in some "rows'. For
    example, it might look like this where the second object has no
    "Male" property:
    public var myData:ArrayCollection = new ArrayCollection([
    {School: "Priorford", All: 95, Male: 92, Female: 98},
    {School: "Giffnock", All: 87, Female: 89},
    {School: "Hastings", All: 80, Male: 78, Female: 82}
    Sometimes I get the following error:
    TypeError: Error #1009: Cannot access a property or method of
    a null object
    reference.
    at mx.charts.chartClasses::NumericAxis/mapCache()
    I'm assuming the error is because of missing data items, but
    I'm not 100% sure. Some data sets with missing items will display
    with no error. I can't see a pattern to those that don't.
    -- I can't produce the error when using a "static" data
    source set in the Flex app itself (such as the example above).
    These always display correctly, even with missing items.
    -- In the problem case, the source data comes from a MySQL
    database through a PHP script that is called with a Flex
    httpService. The returned data is parsed in Flex, and put into the
    ArrayCollection. I was suspecting that the returned data was flawed
    in some way, but the same ArrayCollection displays correctly in a
    DataGrid. The problem is only with the Chart.
    -- I can work round the problem by adding the missing
    properties and setting them to an empty value. But I don't think I
    should have to do this.
    Has anyone seen this problem, or know of any obvious thing I
    might be doing wrong.

    Thanks Arthur.
    Your first suggestion is effectively what I'm doing as a
    workaround. But it is a bit of a pain to have to account for this
    each time when displaying a chart. It's a particular problem when
    you don't know in advance what "categories" might be returned by
    the data and that have to be charted.
    My biggest concern is that this looks like a bug, and the
    fact that it seems to occur intermittently is a bit worrying. (I
    also know that eight out of ten reported "bugs" are user error,
    which is why I was wondering if anyone else had experienced this.)
    About your second suggestion, I think the interpolateValues
    property only applies to lineSeries.

  • Stacked Column Chart with Lines

    Requirement:
    User stacked Column chart to display data for defects for 4 departments.
    1 or 2 lines to show baseline for defects(constant).
    Is there anyway that I can do that just like we can create one in Excel?
    (stack a Stacked column chart with a line chart is not a solution.)
    Any advises?
    Thanks,
    Wen

    Hi Wen,
    I realise that you are not going to get this to work with a standard component on its own. I think it might be possible to acheive it with overlaying barcharts and combination charts.
    My assumption is that you are looking for something that has a stack with 3 separate items in it. Two target lines crossing over the stacked chart.
    I will have a look at this to see if I can come up with something. Let me know if this is not your requirement.
    No, I don't work for SAP. I think those that do have the SAP logo beside them.
    Regards
    Alan

  • Error updating Process Form: Same Column exist with a different variant

    Hi All,
    I have a process form of a resource with following fields :
    Name VariantType Length FieldLabel FieldType Order
    UD_EDIR_BWUSER   boolean       1          BWUser    Checkbox      25
    UD_EDIR_ISUUser    boolean       1          ISUUser    Checkbox      26
    Now, I have to changes these field from boolean to string. For that, I created a new process form version and update like this:
    1. Delete these fields first.
    2. Add two new fields:
    UD_EDIR_BWUSER String 4 BWUser Textfield 25
    UD_EDIR_ISUUser String 4 ISUUser Textfield 26
    Now, when I tried saving the form, I got following error
    Same Column exist with a different variant in current or previous form.
    I also tried creating again a new version of process form and tried updating these field instead of re-creating them but I was able to update the FieldType only ( not able to update the Variant type and length).
    If anyone know how to resolve this issue, please reply.
    Cheers,
    Sunny

    Hi Rajiv,
    Thanks for the reply. I re-created these field in a new version but gave a different name this time like this:
    UD_EDIR_SAP_BW_USER String 4 SAPBWUser TextField 25
    UD_EDIR_SAP_ISU_USER String 4 SAPISUUser TextField 26
    and it worked for me.
    Cheers,
    Sunny

  • How do you combine a stacked column chart with a clustered column chart

    Hello,
    I am trying to combine a stacked column chart with a clustered column chart. I know that in Excel there is a way to trick that described on the next site: http://people.stfx.ca/bliengme/ExcelTips/Columns.htm
    Is that possible with BI Publisher?
    Thank you very much!
    Codruta Crisan

    Finally I get it myself:
    You need to use graph type as BAR_VERT_STACK2Y and the declare the series that you want to see on the first Y vertical bar as assignedToY2="false" and the ones that you wanr to see on the second Y vertical bar as assignedToY2="true".
    In my case I use 4 Series, 2 stack on the first clustured column and 2 stacked on the second (2Y) clustured colum....see below
    graphType="BAR_VERT_STACK2Y">
    <SeriesItems>
    <Series id="0" assignedToY2="false" color="#BBD6E7"/>
    <Series id="1" assignedToY2="false"/>
    <Series id="2" assignedToY2="true" color="#004A96"/>
    <Series id="3" assignedToY2="true"/>
    </SeriesItems>

  • Column Chart with Multiple axes

    Hi folks
    I am using flex 2 charts for displaying data. I want to show my data using column chart with secondary axis. However columns for multiple series are coming one over another. here is the code I have attached:-
    But I want to put columns side by side. Any thoughts will be appreciated.
    Warm Regards
    Rush-me

    Any thoughts?
    Warm Regards
    Rush-me

  • Help Creating Dynamic Stacked Column Chart with Multiple Criteria

    Hi all. Im new here and hoping you can help.  I have a dashboard Im trying to rebuild from scratch (our computer had a meltdown and we lost all our files). I did not build the dashboard initially so Im trying to recreate it from the flash file we were able to recover. I have come across a chart that I just cannot figure out how to do.  I can figure out how to write an array in the Excel sheet that pulls the data into a table the way I need it to be but found out after I wrote that that Xcelcius doesn't support arrays so all my data disappears when I go into preview mode (which is especially frustrating since I can see the chart working fine in design mode).  Anyway this is what the data table looks like
    Month         Year            Company      Positive #          Negative #         Neutral #          Positive %       Negative %      Neutral %
    October      2011            CompanyA      1234                1234                 1234                 10                    10                    10
    October      2011            CompanyB      1234                1234                 1234                 10                    10                    10
    October      2011            CompanyC      1234                1234                 1234                 10                    10                    10
    October      2011            CompanyD      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyA      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyB      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyC      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyD      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyA      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyB      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyC      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyD      1234                1234                 1234                 10                    10                    10
    The original chart was built so that you would choose the month from a combo box and then the company names would show up along the X axis with their % amounts shown in the stacked column.  I know how to make a combo box work and I know how to make a stacked column chart work with static data.  I cannot for the life of me figure out how to get it to work so that when you choose the month from the combo box it filters the data.  I've tried filtered rows but I'm just missing some information that makes it work and I can't figure out what that information is.  It has to be able to get the month/year combo from the combo box and then go to the table, filter it by month and year and then create a multi-row table of data with just the company and the percent values.  Any help would be greatly appreciated!

    Which connection you are using?
    IF quite difficult if you are working under static data.

  • Multiple Line Charts with Column Chart

    I want to show two line charts with a column chart.  Everything goes on the screen fine, except the two line charts origination point always starts at the same point despite the numbers being different.  For example, the ls1 might read 280, 190, 180 and the ls2 is 175, 188, 177 but both origination points start at 280.  The other two datapoints should also be close together but they have a substantial gap of about 50 between them.  Obviosuly I want to have two separate lines.  I have also tried moving the line series below the first lines series with no success.
    <mx:ColumnChart dataTipFunction="formatDataTip"id="
    myChart" dataProvider="
    {FCVData}" showDataTips="
    true"selectionMode="
    single"change="event.stopImmediatePropagation()"
    width="
    100%" height="95%" y="50">
    <!-- vertical axis -->
    <mx:verticalAxis>
    <mx:LinearAxis title="mytitle" labelFunction="defineVerticalLabel"id="
    v1"baseAtZero="
    true" />
    </mx:verticalAxis>
    <mx:horizontalAxis>
    <mx:CategoryAxis dataProvider="
    {MYData}" categoryField="
    YEAR" 
    />
    </mx:horizontalAxis>
    <mx:series>
    <mx:ColumnSeries id="
    pb"color="
    #FFFFFF"xField="
    YEAR" yField="B
    UDGET" displayName="
    Budget"hideDataEffect="
    zoomOut" showDataEffect="
    zoomIn">
    <mx:fill>
    <mx:SolidColor color="{colColor1}"/>
    </mx:fill>
    </mx:ColumnSeries>
    <mx:LineSeries id="ls2" dataProvider="
    {MYData}" yField="
    ACTUAL"displayName="
    Actual" 
    >
    <mx:itemRenderer>  
    <mx:Component>  
    <mx:DiamondItemRenderer/>  
    </mx:Component>  
    </mx:itemRenderer>  
    <mx:lineStroke>
    <mx:Stroke color="
    {lineColor2}" weight="
    5" alpha="
    .5" 
    />
    </mx:lineStroke>  
    <mx:verticalAxis>
    <mx:LinearAxis id="v3" baseAtZero="true"/>
    </mx:verticalAxis>
    </mx:LineSeries>
    <mx:ColumnSeries
    id="
    asytd"color="
    #FFFFFF"xField="
    YEAR" yField="
    SPEND" displayName="
    Spend "hideDataEffect="
    zoomOut" showDataEffect="
    zoomIn">
    <mx:fill>
    <mx:SolidColor color="{colColor2}"/>
    </mx:fill>
    </mx:ColumnSeries>
    <mx:LineSeries id="ls1" dataProvider="
    {MYData}" yField="
    PLAN"displayName="
    Plan" 
    >
    <mx:itemRenderer>  
    <mx:Component>  
    <mx:CrossItemRenderer/>  
    </mx:Component>  
    </mx:itemRenderer>  
    <mx:lineStroke>
    <mx:Stroke color="
    {lineColor1}" weight="
    5" alpha="
    .5" 
    />
    </mx:lineStroke>  
    <mx:verticalAxis>
    <mx:LinearAxis title="title" id="v2" baseAtZero="true"/>
    </mx:verticalAxis>
    </mx:LineSeries>
    </mx:series>
    <mx:verticalAxisRenderers>
    <mx:AxisRenderer placement="left" axis="{v1}"/>
    <mx:AxisRenderer placement="right" axis="{v2}"/>
    <mx:AxisRenderer visible="false" placement="right" axis="{v3}"/>
    </mx:verticalAxisRenderers>
    </mx:ColumnChart>

    Hi,
    Still Trying:
    I've now got this code to function:
    var i:int = 0;
                    for each (var cat:* in event.result.chart.categories.category){
                        //mx.controls.Alert.show(cat.label);
                        var z:int = 0;
                        for each (var valuee:* in event.result.chart.dataset){
                            //mx.controls.Alert.show(event.result.chart.dataset[z].seriesName);
                            //mx.controls.Alert.show(valuee.sete[i].value);
                            z++;
                        i++
    which works fine, how can I get in into Array to make a dataset for the flex charts?
    Thanks,
    Elad

  • SSRS 2008 Column Chart with Calculated Series (moving average) "formula error - there are not enough data points for the period" error

    I have a simple column chart grouping on 1 value on the category axis.  For simplicity's sake, we are plotting $ amounts grouping by Month on the category axis.  I right click on the data series and choose "Add calculated series...".  I choose moving average.  I want to move the average over at least 2 periods.
    When I run the report, I get the error "Formula error - there are not enough data points for the period".  The way the report is, I never have a guaranteed number of categories (there could be one or there could be 5).  When there is 2 or more, the chart renders fine, however, when there is only 1 value, instead of suppressing the moving average line, I get that error and the chart shows nothing.
    I don't think this is entirely acceptable for our end users.  At a minimum, I would think the moving average line would be suppressed instead of hiding the entire chart.  Does anyone know of any workarounds or do I have to enter another ms. connect bug/design consideration.
    Thank you,
    Dan

    I was having the same error while trying to plot a moving average across 7 days. The work around I found was rather simple.
    If you right click your report in the solution explorer and select "View Code" it will give you the underlying XML of the report. Find the entry for the value of your calculated series and enter a formula to dynamically create your periods.
    <ChartFormulaParameter Name="Period">
                      <Value>=IIf(Count(Fields!Calls.Value) >= 7 ,7, (Count(Fields!Calls.Value)))</Value>
    </ChartFormulaParameter>
    What I'm doing here is getting the row count of records returned in the chart. If the returned rows are greater than or equal to 7 (The amount of days I want the average) it will set the points to 7. If not, it will set the number to the amount of returned rows. So far this has worked great. I'm probably going to add more code to handle no records returned although in my case that shouldn't happen but, you never know.
    A side note:
    If you open the calculated series properties in the designer, you will notice the number of periods is set to "0". If you change this it will overwrite your custom formula in the XML.

  • Stacked Column Chart with Line

    Hi
    I need to Create a Stacked Column Chart representing 1 set of measures with a Line representing a target.
    I want to create a chart where the Sales Amount in different Sectors is represented as a stacked column and the targets are represenetd as a line.
    Currently BO supports Bar charts with line.
    Does anyone know if such a feature will be supported in the new release of BO XI. Also is it possible to raise a request for this feature to be included in the new release
    TIA

    We are also a 30 persons department (Marketing) using in the same BO charts (since 2001) quarters made of :
    - first single column ( 2014 billing in a query1)
    - second stacked column (2015 billing +2015  firm orders backlog, 2015 frame orders backlog in a query2)
    - third single column (2016 backlog in a query3)
    and a superposed budget line
    the first and the third column are offset respectively to the left and right of the second column by blank and dummy single columns of data called ghost1 and ghost2. 2016 is still empty here but the principle is clear.
    This principle is used liberally in 200 + different reports. Also with transparent columns and other complicated, but graphically intuitive reports.
    How can we continue to use this very natural representation of our several hundred million $ business. I have not found the mixed single column, stack column and line option in BO XI 3.1 . Please re-develop one asap if necessary. SAP should please please report asap on the recovery timeline of this lost feature. The switch from Visual Basic development to Java development should not lead to regression of any feature.
    Regards.
    Jean-Marc Imbert
    Marketing manager

  • Column chart variable column width in a series

    Hi All
    I am having an array as dataProvider for my column chart where some values are null. Is there any way through which i can define my null values as 0 column width or remove columns from series. sample array as follows -
    <arr X="something" S0Y0="5" S0Y1="3" S1Y0="2" />
    <arr X="something" S0Y0="3" S0Y1="" S1Y0="7" />
    <arr X="something" S0Y0="5" S0Y1="5" S1Y0="" />
    <arr X="something" S0Y0="" S0Y1="3" S1Y0="" />
    <arr X="something" S0Y0="7" S0Y1="4" S1Y0="6" />
    Null values create a hole in column series so all i need to remove the gap in my series.
    any help is highly needed.
    thanks and regards,
    Varun Bajaj

    I'm running into the same problem and was wondering if this ever got resolved.  Here is a graph showing the problem.  As you can see there is a lot of empty space since the data set doesn't have entires for every time period.  If those "low data" dates could be collapsed somewhat it would be great.

  • Need a Query that Returns both Column Name with Column Data

    Hi,
    Hope someone can assist quite quickly. I'm after a query that will return me both column name together with column data, i.e
    Table: APP_INFO
    COL1  - currently has the value of 10
    COL2  - currently has the value of 'HELLO'
    COL3  - currently has the value of 'QWERTY'
    COL4  - currently has the value of 2000Query I'm after is to return the following result set: [actual column name, actual column data]
    COL1,10
    COL2,'HELLO',
    COL3,'QWERTY'
    COL4,2000
    Any help would be much appreciated.
    Thanks.
    Tony.

    Like this ?
    SQL> select empno, ename, deptno from emp where deptno = 10;
         EMPNO ENAME          DEPTNO
          7782 CLARK              10
          7839 KING               10
          7934 MILLER             10
    SQL> select decode(t.id,1,'EMPNO',2,'ENAME',3,'DEPTNO') COLNAME,
      2  decode(t.id,1,to_char(empno),2,ename,3,deptno)
      3  from (select emp.*, rownum rn from emp
      4  where deptno = 10) emp, (select rownum id from dict where rownum <=3) t
      5  order by emp.rn, t.id
      6  /
    COLNAM DECODE(T.ID,1,TO_CHAR(EMPNO),2,ENAME,3,D
    EMPNO  7782
    ENAME  CLARK
    DEPTNO 10
    EMPNO  7839
    ENAME  KING
    DEPTNO 10
    EMPNO  7934
    ENAME  MILLER
    DEPTNO 10
    9 rows selected.Rgds.

  • Column selection with column tree model

    Hello!
    I created a column tree model. I would like to be able to select a column when i click on its header. How can I do that? There is no problem to select one item. I try to select all the items of a column but if do that this is the lines which are selected. The item_selection parameter is set to 'X'.
    Thanks in advance,

    Hi,
    I am not sure if I understood your problem right. But just in case, if you are referring to this...
    You say you need a check box to select your nodes. So you would have to add your item names in a separate column and then add the check box in a separate column using ADD_COLUMN method. You would have to use treemcitac structure and make use of ADD_ITEMS to add them.
    Once you add the column for check box, code your logic and build your tree hierarchy with all the correct node keys. For example, the root node will have node_key = 1 and parent_key = 0. The node that comes under the root node in the first hierarchy level will have node_key = 2 and parent_key = 1. Code your logic so that you build your tree hierarchy.
    Build the tree structure using treemcnota as you have done. Add the nodes built using treemcnota using ADD_NODES.
    According to your requirement,
    COL1                                                                           COL2 (for checkbox)  } -> Build using treemcitac
    Preimport (Root)  -> Root Node
    Request Checks (Node_1)  -> parent_key = Preimport
    Check Req Status (Item_1) -> parent_key = Request Checks (Node_1)
    Check Req Scope (Item_2)
    Check Req Componenets (Item_3)
    Object List Checks (Node_2)
    Check obj type (Item_1)
    check deletions (Item_2)
    Object Checks (Node_3)
    "Build the tree nodes using treemcnota and add these nodes using ADD_NODES
    Again, I am not sure if your problem is this. Hope this might be helpful.

  • Column Chart with different Color

    Hi expert, i need help here, below is my code
    foreach (DataRow row in dtTest.Rows)
    int intIndex = 0;
    string strVLegendName = row["Vehicle"].ToString();
    if (chart1.Series.IndexOf(strVLegendName) != -1)
    chart1.Series[intIndex].ChartType = SeriesChartType.Column;
    chart1.Series[intIndex].BorderWidth = 2;
    chart1.Series[intIndex].ShadowOffset = 5;
    chart1.Series[intIndex].LabelForeColor = Color.Black;
    chart1.Series[intIndex]["DrawingStyle"] = "Cylinder";
    int intYValue = (int)row["Value"];
    chart1.Series[intIndex].Points.AddXY(row["SeriesName"].ToString(), Convert.ToInt32(row["Value"].ToString()));
    chart1.Series[intIndex].IsValueShownAsLabel = true;
    chart1.ChartAreas[intIndex].AxisX.MajorGrid.Enabled = false;
    chart1.ChartAreas[intIndex].AxisY.MajorGrid.Enabled = false;
    else
    chart1.Series.Add(strVLegendName);
    chart1.Series[intIndex].ChartType = SeriesChartType.Column;
    chart1.Series[intIndex].BorderWidth = 2;
    chart1.Series[intIndex].ShadowOffset = 5;
    chart1.Series[intIndex].LabelForeColor = Color.Black;
    chart1.Series[intIndex].Color = Color.Yellow;
    chart1.Series[intIndex]["DrawingStyle"] = "Cylinder";
    int intYValue = (int)row["Value"];
    chart1.Series[intIndex].Points.AddXY(row["SeriesName"].ToString(), Convert.ToInt32(row["Value"].ToString()));
    chart1.Series[intIndex].IsValueShownAsLabel = true;
    chart1.ChartAreas[intIndex].AxisX.MajorGrid.Enabled = false;
    chart1.ChartAreas[intIndex].AxisY.MajorGrid.Enabled = false;
    intIndex++;
    the output is below
    the problem is, instead of the only "Yellow" color in the chart, how can i change it to make it different color for example, Sedan = Yellow, SUV=Red, 4ton=Blue, 8ton=Purple... 
    Thanks in advanced...

    All what you need is to create a small function to pass category and retrurn color as below:
    private Color GetColor(string category)
    switch(category){
    case "Sedan":
    return Color.Yellow;
    case "SUV":
    return Color.Red;
    case "4ton":
    return Color.Blue;
    case "8ton":
    return Color.Purple;
    default:
    return Color.White;
    and then in your code you call it as :
    chart1.Series[intIndex].Color = GetColor(strVLegendName);
    Also note that you can create color from name as below, so if you saving colors in your DB/DT you can just pass as below and it will return color for you.
    Color.FromName("Blue");
    Which you will be able to pass in your code as below:
    chart1.Series[intIndex].Color = Color.FromName(row["DBColor"].ToString());
    Fouad Roumieh

Maybe you are looking for