Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1706
Column Chart formatting/positioning (Winforms)
posted

I have a few questions I have not found answers to.  Note that my column chart only ever shows seven data points.

1.  Is it possible to shift the axis major gridlines so to place them in the middle of the gap between series?  Or can I add a margin to the column bar so it does not take up the entire area like how it is shown in "CategoryXAxis" here: http://help.infragistics.com/Help/Doc/Reporting/2012.2/CLR4.0/html/Chart_Control_Chart_Axes.html
That spacing with the bar and the gridlines is what I am trying to accomplish such that there is a gap between the line and the bar as shown here. (This is the image from that page)

2. Is it possible to use other functions like IF() in the ChartText and Labels ItemFormatString?  I want to add extra text but not have it show when the value is ZERO.
If not then what is the best way to handle this.

3. Is it possible to show data in the labels from other hidden fields in the data source?  If not is it better to use the IRenderLabel interface or just have code manually fill in that data as fixed text?  Note that I would like to show this as a second row of centered data & have found the best way to handle that is to use a second ChartTextAppearance with a new line followed by a space at the end.  This appears to be the only way to get each row in the label to center independently.

I appreciate your quick assistance with these questions.
Seradex.

  • 23930
    Offline posted

    Hello,

    I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.

    Thank you for using Infragistics Components.

  • 23930
    Offline posted

    Hello,

    Thank you for contacting Infragistics Developer Support.

    1. One possible approach to solving this task is to set the space between the series to 0 and use each column as separate series. This will draw the MajorGridLines on the border of the columns. After that you could use the FillSceneGraph event. In it you can reduce the size of the columns and the lines will appear between the columns.
    2. For using if statements in labels you could use the IRenderLabel interface. In it you can add the needed logic for showing the data if the “DATA_VALUE” of the context is greater than 0.
    3. Again you could use the IRenderLabel for this. You could pass the dataset to the class which implements the interface in its constructor. Than you could use the "DATA_ROW" of the context in order to get the row in the dataset.

    I have attached my sample in order to demonstrate this suggestions.

    Please let me know if you have any additional questions.

    WC_ColumnChartFormatting.zip