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

Bar chart with linear axis instead of category axis

3 Answers 170 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Eamon
Top achievements
Rank 1
Eamon asked on 26 Nov 2012, 01:16 AM
Hi, was was wondering if it was possible to have a chart with a linear axis for both the x and y axis that behaves like the bar chart in that each value is drawn as a bar/line from the axis to the value?  The scatter point chart is the closest in behaviour to what I want, but instead of a single point, I need a line from the axis.

regards,
Eamon

3 Answers, 1 is accepted

Sort by
0
Missing User
answered on 28 Nov 2012, 05:56 PM
Hello Eamon,

This scenario is not supported by RadChartView because BarSeries can work only with a categorical axis. Could you please give us an example or a screenshot of what you're trying to achieve? Once we have a better understanding of your scenario we might be able to provide you with a workaround using our control.

Regards,
Ivan N.
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Eamon
Top achievements
Rank 1
answered on 30 Nov 2012, 12:17 AM
Given the following data values: (x,y)
150,300
1100,200
400,300
750,800
900,900

I'd like to produce a chart similar to the image attached (mock up from paint).

Note the linear scaling on the y axis.  Typically the data I would be charting would be a price on the y axis, and volume on the x axis with around 2000 values.  Prices range ~-$1000 to ~$15000 and need resolution to the cent (0.01) so it is not practical to simply create empty values for every 'cent' category because that would mean ~1,600,000 'categories'.

We're currently also evaluating http://www.scichart.com/ and it does seem to be able to do this though it does have some nuances that may not exist in Telerik so I'd like to be able to achieve the same with Telerik before making a decision.

regards,
Eamon

0
Missing User
answered on 04 Dec 2012, 09:54 AM
Hello Eamon,

Thank you for your input. This is the work around we've come up with:
<telerik:ScatterPointSeries ItemsSource="{Binding}"
                   XValueBinding="X"
                   YValueBinding="Y">
    <telerik:ScatterPointSeries.PointTemplate>
        <DataTemplate>
            <Canvas Width="2" Height="2" FlowDirection="RightToLeft">
                <Rectangle Width="2000" Height="2" Fill="Blue"/>
            </Canvas>
        </DataTemplate>
    </telerik:ScatterPointSeries.PointTemplate>
</telerik:ScatterPointSeries>
This code will render the scatter points as lines originating from the Y axis. Alternatively, you can swap the Rectangle's width and height which will change their apparent origin from the X axis.

All the best,
Ivan N.
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Eamon
Top achievements
Rank 1
Answers by
Missing User
Eamon
Top achievements
Rank 1
Share this question
or