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

[Solved] updating Min / Max from client

4 Answers 168 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim
Top achievements
Rank 1
Jim asked on 30 Apr 2012, 09:27 PM
My databinding occurs on the client side but I am setting up the ValueAxis in the view.

e.g.


.ValueAxis(axis => Model.SetupValueAxis(axis)
)
.DataBinding(db => db
      .Ajax().Select("GraphPoints", "Biometric")
)

When a user adds a new value that affect the graph, I simply call rebind on the client side. This of course doesn't get to my code where I setup the ValueAxis. One of the things I do in SetupValueAxis is to set my min and max values.  

Is it possible to setup Min / Max on the client side for the ValueAxis?

4 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 03 May 2012, 08:57 AM
Hello Jim,

Thank you for contacting us.

You need to do:
1) Get the chart.
2) Get the value axis from options of the chart. Then set your maximum to 400(for example).
3) Refresh the chart with the refresh client-side method.

var chart = $("#chart").data("tChart"),
  valueAxis = chart.options.valueAxis;
 
valueAxis.max = 400;
 
chart.refresh();

Kind regards,
Hristo Germanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Jim
Top achievements
Rank 1
answered on 03 May 2012, 02:00 PM
Hi Hirsto - Great and Thanks!

I thought I read that Refresh was deprecated and replaced by Rebind(). Did I misread this? Regardless I will give this a whirl.
0
Hristo Germanov
Telerik team
answered on 03 May 2012, 03:25 PM
Hi Jim,

The refresh client-side method is not deprecated. As you can see here it no longer rebinds the chart, but it still repaints the chart.

Greetings,
Hristo Germanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Jim
Top achievements
Rank 1
answered on 03 May 2012, 03:28 PM
Bonus!! Thank you for clearing that up for me!

Cheers!
Tags
Chart
Asked by
Jim
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Jim
Top achievements
Rank 1
Share this question
or