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

Bind the value of bullet chart series data to another widget like slider

5 Answers 63 Views
BulletChart
This is a migrated thread and some comments may be shown as answers.
Kent
Top achievements
Rank 1
Iron
Kent asked on 18 Mar 2021, 07:33 AM

In order to make an example of a real-time changing bullet chart, I hope that it's possible to bind the series data to the value of slider.

 

Currently I understand chart can use source binding, but I wonder if it's possible to bind one of series data of bullet chart to the value of slider (for example, the current value is bound, and target, category, color are fixed).

Take this for example:

<input data-role="slider" data-bind="value: selectNumber">

<div data-role="chart" data-series="[{ type: 'bullet', currentField: 'current', targetField: 'target', colorField: 'color', target: { color: 'black' } }]" data-bind="source: dsChart"></div>

 

I hope that I can only bind the current value instead of a whole data source (dsChart) to the value of slider (selectNumber).

Furthermore, I also don't know how to bind the data source (dsChart) to the value of slider (selectNumber).

 

Can anyone give me a hint or an example?

 

Thanks.

5 Answers, 1 is accepted

Sort by
0
Kent
Top achievements
Rank 1
Iron
answered on 18 Mar 2021, 07:40 AM

I forgot to add my code to this post and I can't find the edit button, so here's my code on GitHub.

 

https://github.com/kent010341/KendoUI-demo/blob/mvvm-bullet/mvvm_bullet.html

0
Accepted
Tsvetomir
Telerik team
answered on 22 Mar 2021, 04:34 PM

Hi Kent,

It is possible to bind the chart and slider widgets. The value to which the chart is bound has to be dependent on the value of the slider. Here is an example of how to make the two dependent:

https://dojo.telerik.com/AGahagIb

Let me know if additional details are needed.

 

Regards,
Tsvetomir
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Kent
Top achievements
Rank 1
Iron
answered on 23 Mar 2021, 01:04 AM

Hi Tsvetomir.

Thanks for the helping. Now it works fine!

I also add a color changing feature based on your example and had updated on GitHub if anyone is interested.

 

Best regards,

Kent

0
Tsvetomir
Telerik team
answered on 23 Mar 2021, 01:49 PM

Hi Kent,

Thank you for sharing with the community the ultimate solution that you have undertaken. If there is anything else I can help with, let me know.

 

Kind regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Kent
Top achievements
Rank 1
Iron
answered on 24 Mar 2021, 04:02 AM

Hi Tsvetomir,

I have another question posted on Gauges Forum which is similar to this one.

Here's the link of it.

 

https://www.telerik.com/forums/is-it-possible-to-change-pointer-color-of-linear-gauge-dynamically

 

Hope that you can answer that one.

Thanks.

 

Best regards,
Kent

Tags
BulletChart
Asked by
Kent
Top achievements
Rank 1
Iron
Answers by
Kent
Top achievements
Rank 1
Iron
Tsvetomir
Telerik team
Share this question
or