This is a migrated thread and some comments may be shown as answers.

Remove Y-axis Repeated Value

1 Answer 95 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Palaniappan
Top achievements
Rank 1
Palaniappan asked on 19 Jul 2013, 01:13 PM
Hi Telerik Team,

I am using Telerik Radchart. How to remove a repeated Y-axis value? Please see the attached file. Value return in Y-axis value 1. But it is repeated in chart. I don't want this type. In case I will check another condition means like (Value return of 1500) It will work fine like (returns 500, 1000, 1500). I want solution for when value returns 1 means that problem need to resolve.

Please find attached file.

Regards
Palaniappan. R

1 Answer, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 24 Jul 2013, 10:17 AM
Hi Palaniappan,

What you are observing is caused by the YAxis labels format string, which rounds the values to integers. In your case the labels most probably correspond to 1.1, 1.0, 0.9, 0.8, 0.7, 0.6 and 0.5. There are several ways that you can approach the problem:
  • You can change the format string to always display the decimal part of the numbers, like this:
    this.chart.PlotArea.YAxis.Appearance.ValueFormat = ChartValueFormat.Number;
  • Depending on what information you are trying to visualize, you can use different views (separately configured RadCharts), or
  • You can programmatically change the control settings similar to this:
    var data = this.chart.DataSource as List<BusinessObject>;
     
    double max = data.Max(item => item.Value);
     
    if (max > 10.0)
    {
        this.chart.PlotArea.YAxis.Appearance.ValueFormat =
           ChartValueFormat.General;
    }
    else
    {
        this.chart.PlotArea.YAxis.Appearance.CustomFormat = "F2";
        this.chart.PlotArea.YAxis.Appearance.ValueFormat =
           ChartValueFormat.None;
    }
     

I hope this helps. 

Regards,
Petar Kirov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (Obsolete)
Asked by
Palaniappan
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Share this question
or