This is a migrated thread and some comments may be shown as answers.
ChartView Y axis formatting, value too big or too wide ?
2 Answers 6 Views
This is a migrated thread and some comments may be shown as answers.
Dominic
Top achievements
Rank 1
Dominic asked on 01 Jun 2020, 03:38 AM

Hi,

I'm programming with VB.NET, I need help with the ChartView Y-axis value formatting.

Can you let me know how to format the Y-axis with thousand separator instead of the exponential format and how to widen the Y axis if this is the issue.

I attached a screenshot...

Thanks and best regards,

Dominic

2 Answers, 1 is accepted

Sort by
0
Accepted
Nadya
Telerik team
answered on 01 Jun 2020, 03:32 PM

Hello Dominic,

In order to format the Y-axis, you should access the LinearAxis and set its LabelFormat property to the custom format that you would like to display. By default, the AxisLabelElements are as wide as necessary to display the whole value. More information is available here. Below is an example:

Public Sub New()
    InitializeComponent()

    Dim barSeries As BarSeries = New BarSeries()
    barSeries.Name = "Q1"
    barSeries.DataPoints.Add(New CategoricalDataPoint(17000000, DateTime.Now))
    barSeries.DataPoints.Add(New CategoricalDataPoint(128000000, DateTime.Now.AddDays(1)))
    barSeries.DataPoints.Add(New CategoricalDataPoint(143000000, DateTime.Now.AddDays(2)))
    barSeries.DataPoints.Add(New CategoricalDataPoint(111000000, DateTime.Now.AddDays(3)))
    barSeries.DataPoints.Add(New CategoricalDataPoint(118000000, DateTime.Now.AddDays(4)))
    Me.radChartView1.Series.Add(barSeries)
    Dim verticallAxis As LinearAxis = radChartView1.Axes.[Get](Of LinearAxis)(1)
    verticallAxis.LabelFitMode = AxisLabelFitMode.None
    verticallAxis.LabelFormat = "{0:#,###,###}"
End Sub

I hope this helps. Let me know if you need further assistance.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Dominic
Top achievements
Rank 1
answered on 02 Jun 2020, 12:44 AM

Hi Nadya,

 

Great it works perfectly.

 

Thanks,

Dominic

Asked by
Dominic
Top achievements
Rank 1
Answers by
Nadya
Telerik team
Dominic
Top achievements
Rank 1
Share this question
or