ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Autoscale Y-axis when zooming
Posted by Eferov Ivan on Nov-03-2016 08:47
Attachments:
My code:

chartArea = new XYChart(Width - 16, Height - 142);
chartArea.setPlotArea(50, 5, Width - 16 - 100, Height - 142 - 57, 0xffffff, -1, -1, 0xcccccc, 0xcccccc);
chartArea.xAxis().setTickDensity(Width - 16 - 100);
chartArea.setClipping();
chartArea.yAxis2().syncAxis(chartArea.yAxis());
chartArea.xAxis().setLabelFormat("");
chartArea.xAxis().setLabelStyle("Arial", 6);
viewer.ZoomInWidthLimit = 5.0 / ordinalList[0].Count;
chartArea.xAxis().setLabels(xAsixDate[0].ToArray());
try { viewer.setFullRange("x", ordinalList[0][0], ordinalList[0][ordinalList[0].Count - 1]); } catch { }
chartArea.xAxis().setLabelStep(ordinalList[0].Count / timeInterval / 200 * GridFactor);
viewer.syncLinearAxisWithViewPort("x", chartArea.xAxis());

layer[0] = chartArea.addLineLayer2();
layer[0].addDataSet(yAsixDate[0].ToArray(), colorInteget[0]);
layer[0].setXData(ordinalList[0].ToArray());
layer[0].setLineWidth(wLines[0]);
chartArea.yAxis().setAutoScale(0.01, 0.01, 0.01);
viewer.Chart = chartArea;

viewer.ImageMap = chartArea.getHTMLImageMap("clickable", "", "title='{xLabel|mm/dd/yyyy hh:mm:ss} n$ {value}'");

picture 1 - full graph
picture 2 - region of graph


if i use zooming y-axis dont auto scaling based min and max values in visible region on graph
Безымянный.png
12.png

  Re: Autoscale Y-axis when zooming
Posted by Peter Kwan on Nov-04-2016 00:12
Hi Eferov,

In case anyone is reading this thread, the response is at:

http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_support&thread=1478057074#N1478189489