OnDataZoom event for NChartControl


Author
Message
Manal Goyal
Manal Goyal
Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)
Group: Forum Members
Posts: 29, Visits: 405
Hi Team,
I am using zoom for both WPF(NChartControl) and Web application(NThinChartControl). Initially I have scale breaks in my chart with zooming enabled, as soon as user zoom into the chart I want to clear scale breaks, I found a way to do that for NThinChartControl in Nevron.Chart.ThinWeb.NDataZoomTool, I set DataZoomCallback and then in OnDataZoom method I have logic to clear scale breaks.

I wanted to know is it possible to have this functionality in NChartControl? Is there any other workaround to achieve what I want to achieve?

Thanks and regards
Manal

Replies
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Manal,
We were not able to replicate the problem - we tested with the following code:
using Nevron.Chart;
using Nevron.Chart.Windows;
using System;
using System.Windows.Forms;

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


private void Form1_Load(object sender, EventArgs e)
{
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = true;

NAxis axis1 = chart.Axis(StandardAxis.PrimaryY);
ConfigureAxis(axis1, 0, 30, "Signal 1");

NAxis axis2 = chart.Axis(StandardAxis.SecondaryY);
axis2.Visible = true;
ConfigureAxis(axis2, 35, 65, "Signal 2");

NAxis axis3 = ((NCartesianAxisCollection)chart.Axes).AddCustomAxis(AxisOrientation.Vertical, AxisDockZone.FrontRight);
ConfigureAxis(axis3, 70, 100, "Signal 3");

NRangeSelection rangeSelection = new NRangeSelection();
rangeSelection.VerticalValueSnapper = new NAxisRulerMinMaxSnapper();
rangeSelection.VerticalAxisId = axis2.AxisId;
chart.RangeSelections.Add(rangeSelection);

NLineSeries line1 = new NLineSeries();
FillData(line1);
chart.Series.Add(line1);

NLineSeries line2 = new NLineSeries();
FillData(line2);
chart.Series.Add(line2);
line2.DisplayOnAxis(StandardAxis.PrimaryY, false);
line2.DisplayOnAxis(axis2.AxisId, true);

NLineSeries line3 = new NLineSeries();
FillData(line3);
chart.Series.Add(line3);
line3.DisplayOnAxis(StandardAxis.PrimaryY, false);
line3.DisplayOnAxis(axis3.AxisId, true);

nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
nChartControl1.Controller.Tools.Add(new NAxisScrollTool());
nChartControl1.Controller.Tools.Add(new NDataZoomTool());

}

private void FillData(NLineSeries line)
{
Random rand = new Random();
line.DataLabelStyle.Visible = false;
for (int i = 0; i < 100; i++)
{
line.Values.Add(rand.Next(100));
}
}

private void ConfigureAxis(NAxis axis, float beginPercent, float endPercent, string text)
{
axis.Anchor = new NDockAxisAnchor(AxisDockZone.FrontLeft, false, beginPercent, endPercent);

NLinearScaleConfigurator scale = new NLinearScaleConfigurator();
scale.Title.Text = text;
axis.ScaleConfigurator = scale;
}
}
}

and the control was working properly. Can you sends us a small application that replicates this problem?

Best Regards,
Nevron Support Team


Manal Goyal
Manal Goyal
Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)
Group: Forum Members
Posts: 29, Visits: 405
Hi Team,

where should I send the sample application?

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Manal,

Please send the application to support@nevron.com. Thank you.

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Manal Goyal - 7 Years Ago
Nevron Support - 7 Years Ago
Manal Goyal - 7 Years Ago
Nevron Support - 7 Years Ago
Manal Goyal - 7 Years Ago
                         Hi Manal, We're not sure what is the problem - do you want to disable...
Nevron Support - 7 Years Ago
                             Please find attached snaps describing my problem. In the sample...
Manal Goyal - 7 Years Ago
                                 Hi Manal, This code looks ok however it is unclear whether you use a...
Nevron Support - 7 Years Ago
                                     Hi, I have used a similar way that is present in...
Manal Goyal - 7 Years Ago
                                         Hi Manal, We were not able to replicate the problem - we tested with...
Nevron Support - 7 Years Ago
                                             Hi Team, where should I send the sample application?
Manal Goyal - 7 Years Ago
                                                 Hi Manal, Please send the application to support@nevron.com . Thank...
Nevron Support - 7 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search