I have a chart which has too many values to fit comfortably on the screen all at once.
I have made it pannable and zoomable as per the demo example. This works, but the chart initially still opens with all the columns squashed onto the screen.
How can I set a fixed zoom level (which the user can't change) to enable panning of the chart?
Also, will a scrollbar or other visual indicator that a chart can be panned be added soon? Currently it's not very user friendly, and requires an application to find a way to tell users how to scroll the chart. Alternatively, can panning be activated by JavaScript, so some left / right buttons can be added?
The chart code is:-
@(Html.Kendo().Chart<
Dashboard.Models.BarChartDataItem
>(Model)
.Name((string)ViewBag.ChartName)
.Title((string)ViewBag.ChartTitle)
.Theme("bootstrap")
//.RenderAs(RenderingMode.Canvas)
.Legend(legend => legend
.Position(ChartLegendPosition.Top)
.Visible(false)
)
.Series(series =>
{
series.Column(model => model.BarValue).Name("Actual").Labels(l=>l.Template("#=dataItem.ExtraValue#").Visible(true));
})
.ChartArea(area => area
.Height(350)
.Background("transparent")
)
.CategoryAxis(axis => axis
.Categories(model => model.AxisValue)
.Labels(labels => labels.Rotation(-90))
.MajorGridLines(lines => lines.Visible(false))
.Title((string)ViewBag.Xaxis)
)
.Pannable(p=>p.Lock(ChartAxisLock.Y))
.Zoomable(zoomable => zoomable
.Mousewheel(mousewheel => mousewheel.Lock(ChartAxisLock.Y))
.Selection(selection => selection.Lock(ChartAxisLock.Y))
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N2}"))
.Title((string)ViewBag.Yaxis)
.Line(line => line.Visible(false))
)
.Events(e=>e.SeriesClick("seriesClick"))
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0:N2}")
)
)
Thanks