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

Display Boolean Indicators in Y-axis

1 Answer 75 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 08 Oct 2014, 04:45 AM
I have a chartview with a vertical linear axis. I have a dropdown that can be toggled changing the item that is graphed. Typically the item that is graphed is a numeric value that is not bound to any specific range. The chartview component handles this really well and adjusts the Y-axis values/ticks appropriately. No issues. Works well. 

However, I am now getting items that are True/False and I would like to display the as either on/off, or even 1 or 0. Thus I want 2 ticks with the first tick having the value of 0 (minimum) and the second tick have a value of 1. And that is it. How can I do that?

Also, when a new item is selected to graph, I would like to resort to the charts default behavior of readjusting the ticks and values to scale to the values being graphed.

Thank-you.

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 08 Oct 2014, 08:33 AM
Hi Terry,

Our chartview does not have a built-in true-false series. We have a similar control in our Sparklines set, the RadWinLossSparkline.

With the chartview you can use a work around. You can set the ValueBinding property of the series to be a GenericDataPointBinding<YourDataItem, int> and use a ValueSelector that returns a 0 when the value is false, and returns 1 when the value is true. If you are using bar series, you may want to return -1 if the value is false, this highly depends on the desired results. You may need to set a static Minimum and Maximum for the axis. If you want to see "Ture" and "False" labels instead of "1" and "-1" labels on the axis, you can use a LabelTemplate or the LabelTemplateSelector to adjust a desired look.

I hope this inormation helps. Let us know if you need more information.

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ChartView
Asked by
Terry
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or