Home Forums WinForms controls Xceed Chart for WinForms value painting on bar chart

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18886 |

    I would like to ask how to show the chart with 0.5 value painted on the chart outcome. From the chart layout, all value was painted using integer value. How do I do it with 10, 10.5, 20 instead of 10, 20, 30 painted on y-axis.

    Imported from legacy forums. Posted by Steven (had 2382 views)

    Xceed Support
    Member
    Post count: 5658

    You can add your own custom value to the MajorTicks collection.

    You just need to set the MajorTickMode to Manual:

    <code>
    Chart m_chart = chartControl1.Charts[ 0 ];
    LineSeries m_line = ( LineSeries )m_chart.Series.Add( SeriesType.Line );
    m_line.Values.FillRandomRange( 10, 0, 20 );
    m_line.DataLabels.Mode = DataLabelsMode.None;

    Axis Yaxis = m_chart.Axis( StandardAxis.PrimaryY );
    Yaxis.ScaleMode = AxisScaleMode.Numeric;
    Yaxis.NumericScale.MajorTickMode = MajorTickModeNumeric.Manual;
    Yaxis.MajorTicks.Clear();
    Yaxis.MajorTicks.Add( 10.0 );
    Yaxis.MajorTicks.Add( 10.5 );
    Yaxis.MajorTicks.Add( 20.0 );
    </code>

    Imported from legacy forums. Posted by CharlesB (had 3465 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.