Back

ADD Logarithmic Y-Axis in RadHtmlChart

Similar to the feature in RadChart - http://demos.telerik.com/aspnet-ajax/chart/examples/newfeatures/logarithmicaxis/defaultcs.aspx.
For the time being the following workaround can be used:
ASPX:
<script>
function pageLoad() {
var chart = $find("<%=RadHtmlChart1.ClientID%>");
chart._chartObject.options.valueAxis.type = "log";
chart.repaint();
}
</script>
<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="600px" Height="400px">
<PlotArea>
<YAxis></YAxis>
<Series>
<telerik:ColumnSeries>
</telerik:ColumnSeries>
</Series>
</PlotArea>
</telerik:RadHtmlChart>
C#:
protected void Page_Load(object sender, EventArgs e)
{
double[] yValues = new double[] { 0.01, 0.05, 0.11, 2, 2.5, 10, 30 };
for (int i = 0; i < yValues.Length; i++)
{
CategorySeriesItem csi1 = new CategorySeriesItem() { Y = (decimal)yValues[i] };
(RadHtmlChart1.PlotArea.Series[0] as ColumnSeries).SeriesItems.Add(csi1);
}
}
» Post Comment

Comments (6)

 
No comments, yet. Be the first!

Post Comment

Your Comment :
Commenting is disabled when the portal is unlicensed.
Select...