Hi I am having problems with a RadHtmlChart I am using within an Asp page. It is a scatter chart which the data is applied to in the code behind. This all works correctly and plots fine the problem I am having is with trying to set the Min Value on the Xaxis. As I am using date ranges to decrease the amounts of data the chart shows the minimum value on the Xaxis changes so I would like the chart to start at the minimum value + 5. If I set the minimum value for the Xaxis within the configuration wizard this works fine but isn't dynamic enough for what I need. So I am trying in the code behind using the below code:
This assigns the value correctly as I have checked the value in the debugger but the chart never reflects this change. How would I go about changing the minimum value so that I can see more on the chart.
7 Answers, 1 is accepted
I am not sure if I correctly understand what is your requirement about the chart. I can suggest that you provide a small fully runnable sample as well as snapshots of the actual and the expected behavior of the chart, so that I can provide a reliable solution if possible.
Sorry I know it is a bit difficult to explain in text. I have attached a screenshot of the chart at the moment. What I would like is for the graph to start when the data starts not at zero on the x-axis. Below is the code I used to populate the chart. The code below is in a method and I call the method on a date changed event of a calendar which modifys the data selected in the sqldatasource (sqlPcrInfeasLead)
I have tried to reproduce the mentioned issue by using similar values for the scatter chart but the chart axes are properly resized on my side. The chart below renders like this - http://screencast.com/t/kGvMG03gSG
I can suggest that you try the following:
- If you are not using latest Telerik UI (2015.1.401 version), does upgrading to it helps?
- You can manually find the min and the max values of the axis and set them. This can also be done the client-side.
- We have also an idea to implement xAxis.narroRange property for the upcoming Q2 2015 release, so that if everything is fine it will be ready for this release.
I am curious as to how to set the minimum value on the client. I have occasions when I do chart.set_dataSource(...) for data retrieved via Ajax, and I want to force the minimum to zero.
I get the valueAxis via
var myAxis = kendoChart.options.valueAxis, but I do not see minimum as an exposed property.
How would I do this?
Numeric series like scatter and scatterline use yAxis and xAxis client-side objects for its y and x axes. For example, in order to change the max for the x-axis of a scatterline series in this demo (http://demos.telerik.com/aspnet-ajax/htmlchart/examples/charttypes/scatterlinechart/defaultcs.aspx) you can execute the following code in the browser console:
I am using LineSeries, not ScatterLineSeries.
I did as you suggested and accessed the yAxis; the min is an exposed property. However, when I set the min to 0 and redraw, it has no effect.
Should I open a support ticket?
To reference axes in category series you should use valueAxis (y-axis) and categoryAxis (x-axis) objects. For example you can try the following code with this demo (http://demos.telerik.com/aspnet-ajax/htmlchart/examples/charttypes/linechart/defaultcs.aspx):
Regarding the forum threads/support tickets - support tickets have 24-hour maximum lead time for each response Mon-Fri, excluding public holidays. More information on the matter is available here - http://www.telerik.com/purchase/support-plans/devtools. Although we do not officially guarantee a response in a forum thread we try to answer them when possible. That being said if you need a faster answer you can open a support ticket, which however, requires a subscription.