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
4133
Show Data Values On 2D Column Chart
posted

I would like to show data values on a 2D column chart (see attachment).  Currently, I can do this on a 3D pie chart very easily, but I can't figure out how to make it happen on a 2D column chart.  I can't use a 3D chart because there are times when a bank account might be overdrawn and have a negative value.

Parents
  • 5118
    posted

    Hi,

    To get the data values to display on the chart use the ChartText collection. 

    http://help.infragistics.com/doc/WinForms/2016.1/CLR4.0/?page=Chart_Apply_Chart_Text_Labels.html has a walkthrough applying chart text and modifying the alignment of the text.  The basic code would go something like this:

    Infragistics.UltraChart.Resources.Appearance.ColumnChartAppearance columnChartapp = new Infragistics.UltraChart.Resources.Appearance.ColumnChartAppearance();

    Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance chartTextApp = new Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance();

    chartTextApp.ChartTextFont = new System.Drawing.Font("Arial", 7F);

    chartTextApp.ClipText = false;

    chartTextApp.Column = -2;

    chartTextApp.ItemFormatString = "<DATA_VALUE:00.00>";

    chartTextApp.Row = -2;

    chartTextApp.Visible = true;

    columnChartapp.ChartText.Add(chartTextApp);

    this.ultraChart1.ColumnChart = columnChartapp;

Reply Children