The following code demonstrates how to use a Range data series to display an image inside the chart:
using System;
using System.Windows.Forms;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.Chart.WinForm;namespace TextureMappedRange
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// add interactivity tools
nChartControl1.Controller.Tools.Add(new NSelectorTool());
nChartControl1.Controller.Tools.Add(new NAxisScrollTool());
nChartControl1.Controller.Tools.Add(new NDataZoomTool());
// setup chart axes
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NLinearScaleConfigurator();
chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = true;
chart.Axis(StandardAxis.PrimaryY).ScrollBar.Visible = true;
// add a Range series with a single data point to display the image
NRangeSeries range = new NRangeSeries();
range.DataLabelStyle.Visible = false;
range.FillStyle = new NImageFillStyle("D:\\Temp\\img\\EUROPE_map.jpg");
range.UseXValues = true;
range.Values.Add(10);
range.Y2Values.Add(20);
range.XValues.Add(1);
range.X2Values.Add(2);
chart.Series.Add(range);
// add a range selection for the data zoom tool
NRangeSelection rangeSelection = new NRangeSelection();
chart.RangeSelections.Add(rangeSelection);
}
}
}
Best Regards,
Nevron Support Team