protected void Page_Load(object sender, System.EventArgs e) { NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // init document NDrawingView1.Document.BeginInit(); InitDocument(); NDrawingView1.Document.EndInit(); // size view control to content NDrawingView1.SizeToContent(); }
protected void Page_Load(object sender, System.EventArgs e) { NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // init document NDrawingView1.Document.BeginInit(); NDrawingView1.ViewLayout = CanvasLayout.Normal; InitDocument(NDrawingView1.Document, new NFlagsShapesFactory(NDrawingView1.Document)); NDrawingView1.SizeToContent(); NDrawingView1.Document.EndInit(); }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { InitFormControls(); } // begin view init NDrawingView1.ViewLayout = CanvasLayout.Fit; if (!IsPostBack) { RebuildDocument(); } NHtmlImageMapResponse response = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = response; NDrawingView1.ServerSettings.ControlStateSettings.PersistControlState = true; NDrawingView1.EnableViewState = true; }
protected void Page_Load(object sender, System.EventArgs e) { NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // init document NDrawingView1.Document.BeginInit(); NDrawingView1.ViewLayout = CanvasLayout.Normal; // IMPORTANT: the floor plan shapes are defined with they real size in millimeters // that is why we must use drawing scale to display the content of this library NDrawingView1.Document.DrawingScaleMode = DrawingScaleMode.CustomScale; NDrawingView1.Document.MeasurementUnit = NGraphicsUnit.Millimeter; NDrawingView1.Document.CustomWorldMeasurementUnit = NGraphicsUnit.Millimeter; NDrawingView1.Document.CustomScale = 0.01f; InitDocument(NDrawingView1.Document, new NFloorPlanShapesFactory()); NDrawingView1.SizeToContent(); NDrawingView1.Document.EndInit(); }
protected void Page_Load(object sender, System.EventArgs e) { NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; NDrawingView1.ViewLayout = CanvasLayout.Fit; this.Document = NDrawingView1.Document; // start document initialization Document.BeginInit(); Document.Width = 800; Document.Height = 700; Document.Style.TextStyle.TextFormat = TextFormat.XML; Document.Style.StartArrowheadStyle.Shape = ArrowheadShape.None; Document.Style.EndArrowheadStyle.Shape = ArrowheadShape.None; // configure shadow (inherited by all objects) Document.Style.ShadowStyle = new NShadowStyle( ShadowType.GaussianBlur, Color.FromArgb(150, Color.Black), new Nevron.GraphicsCore.NPointL(3, 3), 1, new NLength(4) ); Document.ShadowsZOrder = ShadowsZOrder.BehindDocument; // init scene CreateScene(); // end document initialization Document.EndInit(); Document.Style.InteractivityStyle.Tooltip.Text = "Diagram Background"; }
private void ConfigureControl(NChartControl control, string sLabel) { control.BackgroundStyle.FrameStyle.Visible = false; // generate image map respones NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); control.ServerSettings.BrowserResponseSettings.BrowserResponsePairs.Clear(); control.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // set a chart title NLabel title = control.Labels.AddHeader(sLabel); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL( new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); NLegend legend = control.Legends[0]; legend.SetPredefinedLegendStyle(PredefinedLegendStyle.Bottom); legend.Data.ExpandMode = LegendExpandMode.ColsFixed; legend.Data.ColCount = 2; legend.ShadowStyle.Type = ShadowType.GaussianBlur; NPieChart chart = new NPieChart(); control.Charts.Clear(); control.Charts.Add(chart); chart.DisplayOnLegend = legend; chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.NorthernLights); chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveElevated); chart.BoundsMode = BoundsMode.Fit; chart.Location = new NPointL( new NLength(15, NRelativeUnit.ParentPercentage), new NLength(25, NRelativeUnit.ParentPercentage)); chart.Size = new NSizeL( new NLength(70, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage)); NPieSeries pie = (NPieSeries)chart.Series.Add(SeriesType.Pie); pie.PieStyle = PieStyle.SmoothEdgePie; pie.LabelMode = PieLabelMode.Rim; pie.DataLabelStyle.TextStyle.FontStyle.EmSize = new NLength(8, NGraphicsUnit.Point); pie.Legend.Mode = SeriesLegendMode.DataPoints; pie.Legend.Format = "<label> <percent>"; pie.DataLabelStyle.ArrowLength = new NLength(0f, NRelativeUnit.ParentPercentage); pie.DataLabelStyle.ArrowPointerLength = new NLength(0f, NRelativeUnit.ParentPercentage); pie.AddDataPoint(new NDataPoint(12, "Cars")); pie.AddDataPoint(new NDataPoint(42, "Trains")); pie.AddDataPoint(new NDataPoint(56, "Airplanes")); pie.AddDataPoint(new NDataPoint(23, "Buses")); pie.InteractivityStyles.Add(0, new NInteractivityStyle("Cars", CursorType.Hand)); pie.InteractivityStyles.Add(1, new NInteractivityStyle("Trains", CursorType.Hand)); pie.InteractivityStyles.Add(2, new NInteractivityStyle("Airplanes", CursorType.Hand)); pie.InteractivityStyles.Add(3, new NInteractivityStyle("Buses", CursorType.Hand)); NPostbackAttribute postbackAttribute = new NPostbackAttribute(); for (int i = 0; i < pie.InteractivityStyles.Count; i++) { ((NInteractivityStyle)pie.InteractivityStyles[i]).InteractivityAttributes.Add(postbackAttribute); pie.Detachments.Add(0); } // apply style sheet NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor); styleSheet.Apply(control.Document); }
protected void Page_Load(object sender, EventArgs e) { NChartControl nChartControl1 = new NChartControl(); nChartControl1.Width = 420; nChartControl1.Height = 320; nChartControl1.BackgroundStyle.FrameStyle.Visible = false; // set a chart title NLabel title = nChartControl1.Labels.AddHeader("HTML Image Map and Binary Streaming"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL( new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // setup the legend NLegend legend = nChartControl1.Legends[0]; legend.Mode = LegendMode.Disabled; legend.SetPredefinedLegendStyle(PredefinedLegendStyle.Bottom); // setup a pie chart NPieChart chart = new NPieChart(); nChartControl1.Charts.Clear(); nChartControl1.Charts.Add(chart); chart.DisplayOnLegend = legend; chart.Location = new NPointL( new NLength(10, NRelativeUnit.ParentPercentage), new NLength(17, NRelativeUnit.ParentPercentage)); chart.Size = new NSizeL( new NLength(80, NRelativeUnit.ParentPercentage), new NLength(66, NRelativeUnit.ParentPercentage)); chart.InnerRadius = new NLength(20, NRelativeUnit.ParentPercentage); // add a pie series NPieSeries pieSeries = (NPieSeries)chart.Series.Add(SeriesType.Pie); pieSeries.PieStyle = PieStyle.Torus; pieSeries.LabelMode = PieLabelMode.Rim; pieSeries.DataLabelStyle.Format = "<label> <percent>"; pieSeries.DataLabelStyle.TextStyle.FontStyle.EmSize = new NLength(8, NGraphicsUnit.Point); pieSeries.Legend.Mode = SeriesLegendMode.DataPoints; pieSeries.Legend.Format = "<label> <value>"; pieSeries.Legend.TextStyle.FontStyle.EmSize = new NLength(8, NGraphicsUnit.Point); pieSeries.AddDataPoint(new NDataPoint(12, "Metals")); pieSeries.AddDataPoint(new NDataPoint(42, "Glass")); pieSeries.AddDataPoint(new NDataPoint(23, "Plastics")); pieSeries.AddDataPoint(new NDataPoint(56, "Paper")); pieSeries.AddDataPoint(new NDataPoint(23, "Other")); // add urls to redirect to pieSeries.InteractivityStyles.Add(0, new NInteractivityStyle("Metals")); pieSeries.InteractivityStyles.Add(1, new NInteractivityStyle("Glass")); pieSeries.InteractivityStyles.Add(2, new NInteractivityStyle("Plastics")); pieSeries.InteractivityStyles.Add(3, new NInteractivityStyle("Paper")); pieSeries.InteractivityStyles.Add(4, new NInteractivityStyle("Other")); pieSeries.PieStyle = PieStyle.Torus; pieSeries.LabelMode = PieLabelMode.Spider; NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); imageMapResponse.CreateImageFile = false; imageMapResponse.ImageFileName = "NChartImageMap"; imageMapResponse.ImageMapName = "MAP_NChartImageMap"; nChartControl1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; this.Controls.Add(nChartControl1); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CaptureMouseEventDropDownList.Items.Add("OnClick"); CaptureMouseEventDropDownList.Items.Add("OnDblClick"); CaptureMouseEventDropDownList.Items.Add("OnMouseOut"); CaptureMouseEventDropDownList.Items.Add("OnMouseOver"); CaptureMouseEventDropDownList.Items.Add("OnMouseWheel"); CaptureMouseEventDropDownList.SelectedIndex = 0; } nChartControl1.BackgroundStyle.FrameStyle.Visible = false; // set a chart title NLabel header = nChartControl1.Labels.AddHeader("Capturing Mouse Events"); header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; header.ContentAlignment = ContentAlignment.BottomRight; header.Location = new NPointL( new NLength(2, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // configure the legend NLegend legend = nChartControl1.Legends[0]; legend.SetPredefinedLegendStyle(PredefinedLegendStyle.Right); legend.FillStyle.SetTransparencyPercent(50); legend.Location = new NPointL(new NLength(98, NRelativeUnit.ParentPercentage), legend.Location.Y); // configure the chart NChart chart = nChartControl1.Charts[0]; chart.Axis(StandardAxis.Depth).Visible = false; chart.BoundsMode = BoundsMode.Fit; chart.Location = new NPointL(new NLength(5, NRelativeUnit.ParentPercentage), new NLength(15, NRelativeUnit.ParentPercentage)); chart.Size = new NSizeL(new NLength(70, NRelativeUnit.ParentPercentage), new NLength(70, NRelativeUnit.ParentPercentage)); chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.ShinyTopLeft); // create a bar series NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar); bar.Name = "My Bar Series"; bar.DataLabelStyle.Format = "<value>"; bar.AddDataPoint(new NDataPoint(10, "Ford", new NColorFillStyle(WebExamplesUtilities.RandomColor()))); bar.AddDataPoint(new NDataPoint(20, "Toyota", new NColorFillStyle(WebExamplesUtilities.RandomColor()))); bar.AddDataPoint(new NDataPoint(30, "VW", new NColorFillStyle(WebExamplesUtilities.RandomColor()))); bar.AddDataPoint(new NDataPoint(25, "Mitsubishi", new NColorFillStyle(WebExamplesUtilities.RandomColor()))); bar.AddDataPoint(new NDataPoint(29, "Jaguar", new NColorFillStyle(WebExamplesUtilities.RandomColor()))); bar.Legend.Mode = SeriesLegendMode.DataPoints; bar.BarShape = BarShape.SmoothEdgeBar; bar.DataLabelStyle.Visible = false; for (int i = 0; i < bar.Values.Count; i++) { string customAttribute = CaptureMouseEventDropDownList.SelectedItem.Text + " = \"javascript:alert(' Mouse event [" + CaptureMouseEventDropDownList.SelectedItem.Text + "] intercepted for bar [" + i.ToString() + "] ')\" "; NInteractivityStyle interactivityStyle = new NInteractivityStyle(); interactivityStyle.CustomMapAreaAttribute.JScriptAttribute = customAttribute; bar.InteractivityStyles[i] = interactivityStyle; } // change the response type to image map NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); nChartControl1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; }
protected void Page_Load(object sender, EventArgs e) { nChartControl1.BackgroundStyle.FrameStyle.Visible = false; nChartControl1.Settings.JitterMode = JitterMode.Enabled; NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); nChartControl1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // set a chart title NLabel title = nChartControl1.Labels.AddHeader("HTML Image Map"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; // setup the chart NChart chart = nChartControl1.Charts[0]; chart.Enable3D = true; chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft); chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1); chart.Axis(StandardAxis.Depth).Visible = false; // add a bar series NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar); bar.DataLabelStyle.Visible = false; bar.Legend.Mode = SeriesLegendMode.DataPoints; bar.Legend.Format = "<label> <percent>"; bar.AddDataPoint(new NDataPoint(12, "Cars")); bar.AddDataPoint(new NDataPoint(42, "Trains")); bar.AddDataPoint(new NDataPoint(56, "Buses")); bar.AddDataPoint(new NDataPoint(23, "Ships")); // modify the axis labels NOrdinalScaleConfigurator ordinalScale = (NOrdinalScaleConfigurator)chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator; ordinalScale.AutoLabels = false; for (int i = 0; i < bar.Labels.Count; i++) { ordinalScale.Labels.Add((string)bar.Labels[i]); } // apply style sheet NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.PaleMultiColor); styleSheet.Apply(chart); // apply layout ApplyLayoutTemplate(0, nChartControl1, chart, title, nChartControl1.Legends[0]); // add interactivity styles with the urls to redirect to and the corresponding cursors and tooltips NInteractivityStyle interactivityStyle = new NInteractivityStyle("Click here to jump to Cars sales page", CursorType.Hand); interactivityStyle.UrlLink.OpenInNewWindow = true; interactivityStyle.UrlLink.Url = "../Examples/GettingStarted/NCarSalesPage.aspx"; bar.InteractivityStyles[0] = interactivityStyle; interactivityStyle = new NInteractivityStyle("Click here to jump to Trains sales page", CursorType.Hand); interactivityStyle.UrlLink.OpenInNewWindow = true; interactivityStyle.UrlLink.Url = "../Examples/GettingStarted/NTrainSalesPage.aspx"; bar.InteractivityStyles[1] = interactivityStyle; interactivityStyle = new NInteractivityStyle("Click here to jump to Bus sales page", CursorType.Hand); interactivityStyle.UrlLink.OpenInNewWindow = true; interactivityStyle.UrlLink.Url = "../Examples/GettingStarted/NBusSalesPage.aspx"; bar.InteractivityStyles[2] = interactivityStyle; interactivityStyle = new NInteractivityStyle("Click here to jump to Ship sales page", CursorType.Hand); interactivityStyle.UrlLink.OpenInNewWindow = true; interactivityStyle.UrlLink.Url = "../Examples/GettingStarted/NShipSalesPage.aspx"; bar.InteractivityStyles[3] = interactivityStyle; }
protected void Page_Load(object sender, EventArgs e) { nChartControl1.BackgroundStyle.FrameStyle.Visible = false; NLegend legend = nChartControl1.Legends[0]; legend.ShadowStyle.Type = ShadowType.GaussianBlur; legend.SetPredefinedLegendStyle(PredefinedLegendStyle.Left); legend.Location = new NPointL(legend.Location.X, new NLength(50, NRelativeUnit.ParentPercentage)); legend.ContentAlignment = ContentAlignment.BottomRight; // set a chart title NLabel header = nChartControl1.Labels.AddHeader("Transport Sales Analysis"); header.Location = new NPointL(new NLength(97, NRelativeUnit.ParentPercentage), new NLength(3, NRelativeUnit.ParentPercentage)); header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; header.ContentAlignment = ContentAlignment.BottomLeft; // by default the chart contains a cartesian chart which cannot display pie series nChartControl1.Charts.Clear(); NPieChart chart = new NPieChart(); chart.Enable3D = true; nChartControl1.Charts.Add(chart); chart.DisplayOnLegend = nChartControl1.Legends[0]; NPieSeries pie = (NPieSeries)chart.Series.Add(SeriesType.Pie); pie.AddDataPoint(new NDataPoint(12, "Cars", new NColorFillStyle(Color.Red))); pie.AddDataPoint(new NDataPoint(42, "Trains", new NColorFillStyle(Color.Gold))); pie.AddDataPoint(new NDataPoint(56, "Ships", new NColorFillStyle(Color.Chocolate))); pie.AddDataPoint(new NDataPoint(23, "Buses", new NColorFillStyle(Color.Cyan))); pie.InteractivityStyles.Add(0, new NInteractivityStyle("Cars", CursorType.Hand)); pie.InteractivityStyles.Add(1, new NInteractivityStyle("Trains", CursorType.Hand)); pie.InteractivityStyles.Add(2, new NInteractivityStyle("Ships", CursorType.Hand)); pie.InteractivityStyles.Add(3, new NInteractivityStyle("Buses", CursorType.Hand)); pie.Legend.Mode = SeriesLegendMode.DataPoints; pie.Legend.Format = "<label> <percent>"; pie.PieStyle = PieStyle.SmoothEdgePie; pie.LabelMode = PieLabelMode.Spider; pie.LabelMode = PieLabelMode.Center; pie.DataLabelStyle.ArrowLength = new NLength(0f, NRelativeUnit.ParentPercentage); pie.DataLabelStyle.ArrowPointerLength = new NLength(0f, NRelativeUnit.ParentPercentage); chart.LightModel.EnableLighting = true; chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.NorthernLights); chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveElevated); chart.BoundsMode = BoundsMode.Fit; chart.Location = new NPointL( new NLength(35, NRelativeUnit.ParentPercentage), new NLength(30, NRelativeUnit.ParentPercentage)); chart.Size = new NSizeL( new NLength(60, NRelativeUnit.ParentPercentage), new NLength(60, NRelativeUnit.ParentPercentage)); NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); nChartControl1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; nChartControl1.Settings.JitterMode = JitterMode.Enabled; nChartControl1.Settings.JitteringSteps = 4; // select the car sales by default if (!IsPostBack) { for (int i = 0; i < pie.Values.Count; i++) { pie.Detachments.Add(0); } SalesOverTimeImg.ImageUrl = "NInteractiveCarSalesPage.aspx"; } ApplyImageMapAttributesToSerie(pie); this.nChartControl1.Click += new EventHandler(this.NChartControl1_Click); }
protected void Page_Load(object sender, EventArgs e) { nChartControl1.BackgroundStyle.FrameStyle.Visible = false; nChartControl1.Settings.JitterMode = JitterMode.Enabled; // set a chart title NLabel title = nChartControl1.Labels.AddHeader("HTML Image Map with Postback (Server Events) 2"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL( new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // configure the legend NLegend legend = nChartControl1.Legends[0]; legend.SetPredefinedLegendStyle(PredefinedLegendStyle.Bottom); legend.InteractivityStyle.GeneratePostback = true; legend.Header.Text = "Company Score"; // configure the chart NChart chart = nChartControl1.Charts[0]; chart.Height = 40; chart.Enable3D = true; chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft); chart.Projection.SetPredefinedProjection(PredefinedProjection.OrthogonalHalf); chart.BoundsMode = BoundsMode.Fit; chart.Location = new NPointL( new NLength(8, NRelativeUnit.ParentPercentage), new NLength(15, NRelativeUnit.ParentPercentage)); chart.Size = new NSizeL( new NLength(84, NRelativeUnit.ParentPercentage), new NLength(60, NRelativeUnit.ParentPercentage)); chart.Axis(StandardAxis.Depth).Visible = false; chart.Axis(StandardAxis.Depth).InteractivityStyle.GeneratePostback = true; chart.Axis(StandardAxis.PrimaryX).InteractivityStyle.GeneratePostback = true; chart.Axis(StandardAxis.PrimaryY).InteractivityStyle.GeneratePostback = true; chart.Wall(ChartWallType.Back).InteractivityStyle.GeneratePostback = true; chart.Wall(ChartWallType.Left).InteractivityStyle.GeneratePostback = true; chart.Wall(ChartWallType.Floor).InteractivityStyle.GeneratePostback = true; // add an axis stripe NAxisStripe stripe = chart.Axis(StandardAxis.PrimaryY).Stripes.Add(20, 33); stripe.FillStyle = new NColorFillStyle(Color.PaleGoldenrod); stripe.ShowAtWalls = new ChartWallType[] { ChartWallType.Left, ChartWallType.Back }; stripe.InteractivityStyle.GeneratePostback = true; // setup X axis NOrdinalScaleConfigurator ordinalScale = new NOrdinalScaleConfigurator(); ordinalScale.AutoLabels = false; ordinalScale.Labels.Add("Ford"); ordinalScale.Labels.Add("VW"); ordinalScale.Labels.Add("Toyota"); ordinalScale.Labels.Add("BMW"); ordinalScale.Labels.Add("Peugeot"); chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = ordinalScale; // add a bar chart NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar); bar.Name = "Fictive Car sales"; bar.BarShape = BarShape.SmoothEdgeBar; bar.Legend.Mode = SeriesLegendMode.DataPoints; bar.DataLabelStyle.Visible = true; bar.DataLabelStyle.Format = "<value>"; bar.InteractivityStyle.Tooltip = new NTooltipAttribute("<value> <label>"); bar.AddDataPoint(new NDataPoint(22, "Ford", new NColorFillStyle(Color.DarkKhaki))); bar.AddDataPoint(new NDataPoint(32, "VW", new NColorFillStyle(Color.OliveDrab))); bar.AddDataPoint(new NDataPoint(45, "Toyota", new NColorFillStyle(Color.DarkSeaGreen))); bar.AddDataPoint(new NDataPoint(27, "BMW", new NColorFillStyle(Color.CadetBlue))); bar.AddDataPoint(new NDataPoint(40, "Peugeot", new NColorFillStyle(Color.LightSlateGray))); for (int i = 0; i < bar.Values.Count; i++) { NInteractivityStyle interactivityStyle = new NInteractivityStyle(); interactivityStyle.GeneratePostback = true; bar.InteractivityStyles[i] = interactivityStyle; } // configure the control to generate image map with postback NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); imageMapResponse.GridCellSize = 2; nChartControl1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; this.nChartControl1.Click += new EventHandler(this.NChartControl1_Click); }