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

Negative Y Axis and Calculated X axis

7 Answers 170 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Smo
Top achievements
Rank 1
Smo asked on 10 Aug 2012, 04:31 PM
I need to implement the chart in attach dinamically.
Is it possible to have a vertical axis with decrement from positive value to negative value?
Is it possible to have an horizzontal axis where the current step is double of his previous?
Thanks a lot

Simone Giorgio
Spindox Italy


 

7 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 15 Aug 2012, 12:42 PM
Hi,

Yes this is absolutely possible. The feature you want on the Horizontal Axis is called Logarithmic Axis. In order to make each next step twice as large as the previous you have to set the LogarithmBase property to "2". Please note that by default the LogarithmicAxis will use round numbers (LorithmBase to the power of x - in the case of 2: 1, 2, 4, 8, 16, 32, ...) so if you want the axis to start at a specific value (125 for example) you will have to set manually the range of the axis by setting the Minimum and Maximum properties.

Here is an example:

<telerik:RadCartesianChart>
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY"/>
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:LogarithmicAxis LogarithmBase="2"
                                 Minimum="125" Maximum="8000"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Maximum="10" Minimum="-130"/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:ScatterLineSeries>
            <telerik:ScatterLineSeries.DataPoints>
                <telerik:ScatterDataPoint YValue="-40" XValue="125"/>
                <telerik:ScatterDataPoint YValue="-50" XValue="250"/>
                <telerik:ScatterDataPoint YValue="-60" XValue="500"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="1000"/>
                <telerik:ScatterDataPoint YValue="-80" XValue="2000"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="4000"/>
            </telerik:ScatterLineSeries.DataPoints>
        </telerik:ScatterLineSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

Regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Smo
Top achievements
Rank 1
answered on 29 Aug 2012, 05:14 PM
Hi Petar,
thank you for your answer.
The problem with your example is that Y axis start from -130 to +10 without 0

Our need is to start from 130 to -10 with 0 (as you can see in attachement on the first post)
Is it possible?
Thanks
Simone
0
Evgenia
Telerik team
answered on 03 Sep 2012, 08:13 AM
Hello Smo,

 You'll have to predefine custom range for the Vertical Axis where the Minimum is -10 an the Maximum is 130 with strict MajorStep set to 10 so that your 0 will be visible. This is mentioned in our documentation.
Let me know if you need further assistance with this one.

Kind regards,
Evgenia
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Smo
Top achievements
Rank 1
answered on 03 Sep 2012, 11:18 AM
Thanks Evgenia,
your solution it's ok,but we need  to configure the opposite of your solution.
Mininum=130,Maximum=-10(you can see the attach in the first post)
Actually,with this configuration,the chart doesn't show the range.

We discovered that RadChart control has the isInverse property on Axis(it would be our need),but it's not able to show two series like RadCartesianChart we are consuming.(and we need it)
Thank you
0
Evgenia
Telerik team
answered on 05 Sep 2012, 10:22 AM
Hi Smo,

 I understand your requirement. Unfortunately we do not support inverse axis for RadChartView. Our developers have this in mind and it is in our future development plans but at present I can't provide you with an exact timeframe for it.
As a work-around I would suggest that you set your Minumum to -130 and Maximum to 10 and then in Loaded event of the Vertical Axis to supress the - sign with a Custom Numeric Format String and append "-" sign to the positive number (10 in your case). The code is below:

<telerik:RadCartesianChart x:Name="chart">
          <telerik:RadCartesianChart.Grid>
              <telerik:CartesianChartGrid MajorLinesVisibility="XY"/>
          </telerik:RadCartesianChart.Grid>
          <telerik:RadCartesianChart.HorizontalAxis>
              <telerik:LogarithmicAxis LogarithmBase="2"
                               Minimum="125" Maximum="8000"/>
          </telerik:RadCartesianChart.HorizontalAxis>
          <telerik:RadCartesianChart.VerticalAxis>
              <telerik:LinearAxis Minimum="-130" Maximum="10" MajorStep="10" />
          </telerik:RadCartesianChart.VerticalAxis>
          <telerik:RadCartesianChart.Series>
              <telerik:ScatterLineSeries>
                  <telerik:ScatterLineSeries.DataPoints>
                      <telerik:ScatterDataPoint YValue="-40" XValue="125"/>
                      <telerik:ScatterDataPoint YValue="-50" XValue="250"/>
                      <telerik:ScatterDataPoint YValue="-60" XValue="500"/>
                      <telerik:ScatterDataPoint YValue="-70" XValue="1000"/>
                      <telerik:ScatterDataPoint YValue="-80" XValue="2000"/>
                      <telerik:ScatterDataPoint YValue="-70" XValue="4000"/>
                  </telerik:ScatterLineSeries.DataPoints>
              </telerik:ScatterLineSeries>
          </telerik:RadCartesianChart.Series>
      </telerik:RadCartesianChart>

public MainWindow()
     {
         InitializeComponent();
         chart.VerticalAxis.Loaded += new RoutedEventHandler(VerticalAxis_Loaded);
     }
     void VerticalAxis_Loaded(object sender, RoutedEventArgs e)
     {
         chart.VerticalAxis.LabelFormat = "-#;##;0";
     }

Please note that this is more like a suggestion which should help you workaround the missing Inverse axis feature, but we do not guarantee the result if you change the series or the type of axis.

All the best,
Evgenia
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Bárbara
Top achievements
Rank 1
answered on 19 Nov 2015, 12:36 PM

Hi,

I know this is an old post but I want to know if now RadChartView supports Inverse Axis.

Thanks!

0
Evgenia
Telerik team
answered on 19 Nov 2015, 03:32 PM
Hi,

Yes, RadChartView supports InverseAxis by setting the IsInverse boolean property of the corresponding LinearAxis to False. We have this demonstrated in our online demo -- here is link to it.

Regards,
Evgenia
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ChartView
Asked by
Smo
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Smo
Top achievements
Rank 1
Evgenia
Telerik team
Bárbara
Top achievements
Rank 1
Share this question
or