Bar chart data labels

Posted by: ginacresse on 8 September 2017, 2:45 pm EST

  • Posted 8 September 2017, 2:45 pm EST

    I'm using the following code to bind a dataset to a chart.  Everything works fine except I would like to have the values from Column(0) [i.e. DS.Tables(3).Columns(0).ToString] as the labels across the bottom of the chart rather than sequential numbers.  Is that possible?



    Dim series As New FarPoint.Win.Chart.BarSeries


    series.Values.DataSource = DS.Tables(3)


    series.Values.DataField = DS.Tables(3).Columns(2).ColumnName


    series.LabelVisible = True


    Dim model As New FarPoint.Win.Chart.ChartModel()


    Dim plotArea As New FarPoint.Win.Chart.YPlotArea()


    plotArea.Location = New PointF(0.2F, 0.2F)


    plotArea.Size = New SizeF(0.6F, 0.6F)


    plotArea.Series.Add(series)


    model.PlotAreas.Add(plotArea)


    FpChart1.Model = model


    I figured out how to use the CatagoryNames to get the results I want, but now I need to widen the category columns because the text is over-writing.



     

  • Replied 8 September 2017, 2:45 pm EST

    Hello,

    The labels on the X-Axis are getting overwritten because the labels are long in length and more in number, than the size of the chart, and since all of them must be displayed, they are getting overwritten. I would suggest you to increase the size of the chart to resolve your issue as it would provide the labels enough space to be displayed without being overwritten. Please let me know if you have any queries further.

    Thanks,

    Manpreet Kaur.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels