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

Reverse Order

6 Answers 52 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 24 Sep 2012, 09:49 PM
I have a chart the need to change the bottom order for a Spline chart I have create.

<telerik:RadChart
    ID="RadChartDemographic"
    runat="server"
    DefaultType="Spline"
    Skin="Gray"
    ChartTitle-TextBlock-Text="Demographic%">
    <Series>
        <telerik:ChartSeries DataYColumn="Minority" Name="Minority" Type="Spline">
            <Appearance>
                <FillStyle MainColor="0, 116, 119" />
            </Appearance>
        </telerik:ChartSeries>
        <telerik:ChartSeries DataYColumn="White" Name="White" Type="Spline">
            <Appearance>
                <FillStyle MainColor="195, 167, 10" />
            </Appearance>
        </telerik:ChartSeries>
    </Series>
</telerik:RadChart>


For example:

1 |
2 |
3 |          -   -   - 
4 |       /             \
5 |     /                 \
    ----------------------------------
         1           2            3

I need to change the bottom number order to 3, 2, 1. I have reorder my query, but the numbers stay the same on the bottom. The confusing thing is that the data points in the graph change and do not correlate to the bottom row...

TIA

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 25 Sep 2012, 10:37 AM
Hi Steve,

One suggestion is that you can reverse the data before passing it on to the chart control as follows. 

C#:
protected void Page_Load(object sender, EventArgs e)
{
  int[] array1 = new int[] { 1, 3, 5, 7, 9 };
  Array.Reverse(array1);
  RadChart1.DataSource = array1;
  RadChart1.DataBind();
}

Thanks,
Princy.
0
Steve
Top achievements
Rank 1
answered on 25 Sep 2012, 02:56 PM
Thanks Princy,

I have tried this. I have a Linq query and using "orderby x ascending". the lines are basically mirror images, however the bottom number are not changing???

Thanks again,

Steve
0
Richard
Top achievements
Rank 1
answered on 25 Sep 2012, 03:48 PM
Steve,

Unfortunately, RadChart  for ASP.NET AJAX does not provide a setting to enable an inverse axis, as does the RadChart for Silverlight, documented here.

If you have not already referenced this thread, I'd suggest you do so:

Change the left axis to descending order

Telerik Admin: Evgenia has provided a project demonstrating an approach to create an inverse Axis, and shows how to suppress negative values.

I hope this helps.

Cheers,
0
Steve
Top achievements
Rank 1
answered on 25 Sep 2012, 04:20 PM
This flipped the data upside down. I also tried the X and Y values.

Here is what I am looking to do:

1 |
2 |
3 |          -   -   - 
4 |       /             \
5 |     /                 \
    ----------------------------------
         1           2            3

Should be

1 |
2 |
3 |                   -   -   - 
4 |                /             \
5 |              /                 \
    ----------------------------------
         3           2            1

Please note that the data is right, but the "3,2,1" values are not being displayed as I require them.
0
Evgenia
Telerik team
answered on 27 Sep 2012, 01:17 PM
Hello Steve,

 Unfortunately as Richard said, there is no built-in inverse axis functionality with RadChart for ASP.NET AJAX. Since the workaround provided in the forum thread is not applicable for you, the onliest thing I can suggest is that you use the Silverlight RadChart with Inverse Yaxis as shown here.
You can integrate the SL chart in your website the same way we did in this demo with source code provided. Please check the demos' description where more resources of the approach used are provided.

Kind regards,
Evgenia
the Telerik team

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 their blog feed now.
0
Steve
Top achievements
Rank 1
answered on 27 Sep 2012, 04:21 PM
Thanks Evgenia,

One question? Could one declarative set the bottom row? I can get the data to display the way we want, but the bottom numbers are the only issue.

I will look into the Silverlight control...

Thanks,

Steve
Tags
Chart (Obsolete)
Asked by
Steve
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Steve
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or