Negative Y Axis and Calculated X axis

8 posts, 0 answers
  1. Smo
    Smo avatar
    3 posts
    Member since:
    Aug 2012

    Posted 10 Aug 2012 Link to this post

    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


     
  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 15 Aug 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Smo
    Smo avatar
    3 posts
    Member since:
    Aug 2012

    Posted 29 Aug 2012 Link to this post

    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
  5. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 03 Sep 2012 Link to this post

    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.

  6. Smo
    Smo avatar
    3 posts
    Member since:
    Aug 2012

    Posted 03 Sep 2012 Link to this post

    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
  7. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 05 Sep 2012 Link to this post

    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.

  8. Bárbara
    Bárbara avatar
    16 posts
    Member since:
    Nov 2015

    Posted 19 Nov 2015 in reply to Evgenia Link to this post

    Hi,

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

    Thanks!

  9. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 19 Nov 2015 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready