How to use NZoomTool and NAxisScrollTool together, as my way of doing this causes problem with...


How to use NZoomTool and NAxisScrollTool together, as my way of doing...
Author
Message
Atif Riaz
Atif Riaz
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)
Group: Forum Members
Posts: 4, Visits: 1
Below is the code used for creating chart with NZoomTool and NAxisScrollTool together. After zooming in or out, the scrollbars hovering functionality behave strangly (the scrollbar buttons highlight when mouse is slightly off the buttons). I am sure I am doing something silly or is there some other way to do this?



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.Chart.WinForm;

namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

nChartControl1.Legends.Clear();

NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

NAxis axisX = chart.Axis(StandardAxis.PrimaryX);
NNumericAxisPagingView xPagingView = new NNumericAxisPagingView(new NRange1DD(0, 100));
xPagingView.MinPageLength = 1.0;
axisX.PagingView = xPagingView;
axisX.ScrollBar.Visible = true;

NAxis axisY = chart.Axis(StandardAxis.PrimaryY);
NNumericAxisPagingView yPagingView = new NNumericAxisPagingView(new NRange1DD(0, 100));
yPagingView.MinPageLength = 1.0;
axisY.PagingView = yPagingView;
axisY.ScrollBar.Visible = true;

Random rand = new Random();
NPointSeries lineSeries = (NPointSeries)chart.Series.Add(SeriesType.Point);
for (int i = 0; i < 100; i++)
{
lineSeries.UseXValues = true;
lineSeries.XValues.Add(rand.Next(100));
lineSeries.Values.Add(rand.Next(100));
}

nChartControl1.Controller.Tools.Add(new NSelectorTool());
nChartControl1.Controller.Tools.Add(new NZoomTool());
nChartControl1.Controller.Tools.Add(new NAxisScrollTool());
}
}
}

Reply
joern kunze
joern kunze
Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)
Group: Forum Members
Posts: 86, Visits: 221
... just a further remark:

the sequenze of the commands _NevronChart.Controller.Tools.Add when initializing the chart is very important:

//works perfect:
_NevronChart.Controller.Tools.Add(new NSelectorTool());

_DataZoomTool = new NDataZoomTool();
_NevronChart.Controller.Tools.Add(_DataZoomTool);

_AxisScrollTool = new NAxisScrollTool();
_NevronChart.Controller.Tools.Add(_AxisScrollTool);

//behaves strangly with "normal" data / application crash with larger data when chart is initialized again:
_DataZoomTool = new NDataZoomTool();
_NevronChart.Controller.Tools.Add(_DataZoomTool);

_AxisScrollTool = new NAxisScrollTool();
_NevronChart.Controller.Tools.Add(_AxisScrollTool);

_NevronChart.Controller.Tools.Add(new NSelectorTool());

Best regards,
Joern
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search