private void UpdateChartInteractivity()
        {
            if (nChartControl1 == null)
            {
                return;
            }

            nChartControl1.Controller.Tools.Clear();

            if (EnableTooltipChangeCheckBox.Checked == true)
            {
                NTooltipTool tooltip = new NTooltipTool();

                tooltip.AutoPopDelay = (int)AutoPopDelayUpDown.Value;
                tooltip.ReshowDelay  = (int)ReshowDelayUpDown.Value;
                tooltip.InitialDelay = (int)InitialDelayUpDown.Value;

                nChartControl1.Controller.Tools.Add(tooltip);
            }

            if (CursorChangeCheckBox.Checked == true)
            {
                NCursorTool cursorTool = new NCursorTool();
                nChartControl1.Controller.Tools.Add(cursorTool);
            }
        }
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Tooltips and Cursor");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

            // init the values for the tooltip properties
            NTooltipTool tooltip = new NTooltipTool();

            AutoPopDelayUpDown.Value = tooltip.AutoPopDelay;
            InitialDelayUpDown.Value = tooltip.InitialDelay;
            ReshowDelayUpDown.Value  = tooltip.ReshowDelay;

            m_Chart = nChartControl1.Charts[0];
            m_Chart.Axis(StandardAxis.Depth).Visible = false;

            // Add stripes for the left and the bottom axes
            NAxisStripe s1 = m_Chart.Axis(StandardAxis.PrimaryY).Stripes.Add(50, 60);
            NAxisStripe s2 = m_Chart.Axis(StandardAxis.PrimaryX).Stripes.Add(2, 3);

            s1.FillStyle = new NColorFillStyle(Color.CornflowerBlue);
            s1.SetShowAtWall(ChartWallType.Left, true);
            s2.FillStyle = new NColorFillStyle(Color.DarkOrange);

            // Create a bar series
            m_Bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar);

            m_Bar.BarShape    = BarShape.Bar;
            m_Bar.Legend.Mode = SeriesLegendMode.DataPoints;
            m_Bar.Values.Add(20.0);
            m_Bar.Values.Add(60.0);
            m_Bar.Values.Add(50.0);
            m_Bar.Values.Add(80.0);
            m_Bar.Values.Add(60.0);

            m_Bar.InteractivityStyles.Add(0, new NInteractivityStyle("Data item 0", CursorType.Default));
            m_Bar.InteractivityStyles.Add(1, new NInteractivityStyle("Data item 1", CursorType.Default));
            m_Bar.InteractivityStyles.Add(2, new NInteractivityStyle("Data item 2", CursorType.Default));
            m_Bar.InteractivityStyles.Add(3, new NInteractivityStyle("Data item 3", CursorType.Default));
            m_Bar.InteractivityStyles.Add(4, new NInteractivityStyle("Data item 4", CursorType.Default));

            // set some fill styles in the collection.
            NFillStyle fillStyle;

            fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.Chocolate, Color.WhiteSmoke);
            m_Bar.FillStyles.Add(0, fillStyle);

            fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.Goldenrod, Color.WhiteSmoke);
            m_Bar.FillStyles.Add(1, fillStyle);

            fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.OliveDrab, Color.WhiteSmoke);
            m_Bar.FillStyles.Add(2, fillStyle);

            fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.SteelBlue, Color.WhiteSmoke);
            m_Bar.FillStyles.Add(3, fillStyle);

            fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.BlueViolet, Color.WhiteSmoke);
            m_Bar.FillStyles.Add(4, fillStyle);

            // init form controls
            EnableTooltipChangeCheckBox.Checked = true;
            CursorChangeCheckBox.Checked        = true;

            ChartObjectComboBox.Items.Add("Background");
            ChartObjectComboBox.Items.Add("Back chart wall");
            ChartObjectComboBox.Items.Add("Left chart wall");
            ChartObjectComboBox.Items.Add("Floor chart wall");
            ChartObjectComboBox.Items.Add("Primary Y axis");
            ChartObjectComboBox.Items.Add("Primary X axis");
            ChartObjectComboBox.Items.Add("Horizontal stripe");
            ChartObjectComboBox.Items.Add("Vertical stripe");
            ChartObjectComboBox.Items.Add("Legend");
            ChartObjectComboBox.Items.Add("Data item 0");
            ChartObjectComboBox.Items.Add("Data item 1");
            ChartObjectComboBox.Items.Add("Data item 2");
            ChartObjectComboBox.Items.Add("Data item 3");
            ChartObjectComboBox.Items.Add("Data item 4");
            ChartObjectComboBox.SelectedIndex = 0;

            CursorComboBox.FillFromEnum(typeof(CursorType));
            CursorComboBox.SelectedIndex = 0;
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!NThinChartControl1.Initialized)
            {
                // enable jittering (full scene antialiasing)
                NThinChartControl1.Settings.JitterMode = JitterMode.Enabled;
                NThinChartControl1.Panels.Clear();

                // apply background image border
                NImageFrameStyle frame = new NImageFrameStyle();
                frame.Type              = ImageFrameType.Raised;
                frame.BackgroundColor   = Color.White;
                frame.BorderStyle.Color = Color.Gainsboro;
                NThinChartControl1.BackgroundStyle.FrameStyle = frame;
                NThinChartControl1.BackgroundStyle.FillStyle  = new NGradientFillStyle(Color.White, Color.GhostWhite);

                // set a chart title
                NLabel title = new NLabel("Postback Tool");
                NThinChartControl1.Panels.Add(title);
                title.DockMode                   = PanelDockMode.Top;
                title.Padding                    = new NMarginsL(4, 6, 4, 6);
                title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
                title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

                // configure the legend
                NLegend legend = new NLegend();
                NThinChartControl1.Panels.Add(legend);
                legend.DockMode = PanelDockMode.Right;
                legend.Padding  = new NMarginsL(1, 1, 3, 3);
                legend.FillStyle.SetTransparencyPercent(50);
                legend.OuterBottomBorderStyle.Width = new NLength(0, NGraphicsUnit.Pixel);
                legend.OuterLeftBorderStyle.Width   = new NLength(0, NGraphicsUnit.Pixel);
                legend.OuterRightBorderStyle.Width  = new NLength(0, NGraphicsUnit.Pixel);
                legend.OuterTopBorderStyle.Width    = new NLength(0, NGraphicsUnit.Pixel);
                legend.HorizontalBorderStyle.Width  = new NLength(0, NGraphicsUnit.Pixel);
                legend.VerticalBorderStyle.Width    = new NLength(0, NGraphicsUnit.Pixel);

                // configure the chart
                NCartesianChart chart = new NCartesianChart();
                NThinChartControl1.Panels.Add(chart);
                chart.Enable3D         = true;
                chart.Fit3DAxisContent = true;
                chart.DisplayOnLegend  = legend;
                chart.BoundsMode       = BoundsMode.Fit;
                chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);
                chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
                chart.DockMode = PanelDockMode.Fill;
                chart.Padding  = new NMarginsL(
                    new NLength(3, NRelativeUnit.ParentPercentage),
                    new NLength(3, NRelativeUnit.ParentPercentage),
                    new NLength(3, NRelativeUnit.ParentPercentage),
                    new NLength(3, NRelativeUnit.ParentPercentage));

                // setup the X axis
                NAxis axisX = chart.Axis(StandardAxis.PrimaryX);
                NOrdinalScaleConfigurator scaleX = (NOrdinalScaleConfigurator)axisX.ScaleConfigurator;
                scaleX.MajorTickMode = MajorTickMode.AutoMaxCount;

                // add interlaced stripe for the Y axis
                NAxis axisY = chart.Axis(StandardAxis.PrimaryY);
                NLinearScaleConfigurator scaleY     = (NLinearScaleConfigurator)axisY.ScaleConfigurator;
                NScaleStripStyle         stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);
                stripStyle.Interlaced  = true;
                stripStyle.ShowAtWalls = new ChartWallType[] { ChartWallType.Back, ChartWallType.Left };
                scaleY.StripStyles.Add(stripStyle);

                // hide the depth axis
                chart.Axis(StandardAxis.Depth).Visible = false;

                // add a bar series and fill it with data
                NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);
                bar.Name        = "Simple Bar Chart";
                bar.BarShape    = BarShape.SmoothEdgeBar;
                bar.Legend.Mode = SeriesLegendMode.DataPoints;
                bar.Legend.TextStyle.FontStyle.EmSize = new NLength(8, NGraphicsUnit.Point);
                bar.DataLabelStyle.Visible            = false;

                bar.AddDataPoint(new NDataPoint(16, "Spain"));
                bar.AddDataPoint(new NDataPoint(42, "France"));
                bar.AddDataPoint(new NDataPoint(56, "Germany"));
                bar.AddDataPoint(new NDataPoint(23, "Italy"));
                bar.AddDataPoint(new NDataPoint(47, "UK"));
                bar.AddDataPoint(new NDataPoint(38, "Sweden"));

                for (int i = 0; i < bar.Values.Count; i++)
                {
                    bar.InteractivityStyles[i] = new NInteractivityStyle("Click on bar to make it red");
                }

                // apply style sheet
                NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor);
                styleSheet.Apply(bar);

                NThinChartControl1.Controller.Tools.Add(new NPostbackTool());
            }

            NThinChartControl1.Postback += new NPostbackEventHandler(NThinChartControl1_Postback);
            NThinChartControl1.Controller.Tools.Clear();

            NTooltipTool tooltipTool = new NTooltipTool();

            NThinChartControl1.Controller.Tools.Add(tooltipTool);

            NPostbackTool postbackTool = new NPostbackTool();

            postbackTool.PostbackOnlyOnInteractiveItems = PostbackOnlyOnInteractiveItemsCheckBox.Checked;
            NThinChartControl1.Controller.Tools.Add(postbackTool);
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // begin view init
            base.DefaultGridOrigin   = new NPointF(30, 30);
            base.DefaultGridCellSize = new NSizeF(100, 50);
            base.DefaultGridSpacing  = new NSizeF(50, 40);

            NDrawingDocument document = NThinDiagramControl1.Document;

            if (!NThinDiagramControl1.Initialized)
            {
                NThinDiagramControl1.View.Layout = CanvasLayout.Fit;
                // add the client mouse event tool
                NThinDiagramControl1.Controller.Tools.Add(new NPostbackTool());

                document.BeginInit();

                document.BackgroundStyle.FrameStyle.Visible = false;
                document.AutoBoundsPadding = new Nevron.Diagram.NMargins(10f, 10f, 10f, 10f);
                document.Style.FillStyle   = new NColorFillStyle(Color.White);

                NBasicShapesFactory factory = new NBasicShapesFactory(document);

                NShape outerCircle = factory.CreateShape(BasicShapes.Circle);
                outerCircle.Bounds = new NRectangleF(0f, 0f, 200f, 200f);
                document.ActiveLayer.AddChild(outerCircle);

                NShape rect = factory.CreateShape(BasicShapes.Rectangle);
                rect.Bounds                   = new NRectangleF(42f, 42f, 50f, 50f);
                rect.Style.FillStyle          = new NColorFillStyle(Color.LightBlue);
                rect.Style.InteractivityStyle = CreateInteractivityStyle("Rectangle");
                rect.Tag = true;
                document.ActiveLayer.AddChild(rect);

                NShape triangle = factory.CreateShape(BasicShapes.Triangle);
                triangle.Bounds                   = new NRectangleF(121f, 57f, 60f, 55f);
                triangle.Style.FillStyle          = new NColorFillStyle(Color.LightBlue);
                triangle.Style.InteractivityStyle = CreateInteractivityStyle("Triangle");
                triangle.Tag = true;
                document.ActiveLayer.AddChild(triangle);

                NShape pentagon = factory.CreateShape(BasicShapes.Pentagon);
                pentagon.Bounds                   = new NRectangleF(60f, 120f, 54f, 50f);
                pentagon.Style.FillStyle          = new NColorFillStyle(Color.LightBlue);
                pentagon.Style.InteractivityStyle = CreateInteractivityStyle("Pentagon");
                pentagon.Tag = true;
                document.ActiveLayer.AddChild(pentagon);

                document.SizeToContent();
                document.EndInit();
            }

            // Create a few simple shapes with attached client mouse event interactivity
            NThinDiagramControl1.Postback += new NPostbackEventHandler(NThinDiagramControl1_Postback);
            NThinDiagramControl1.Controller.Tools.Clear();

            NTooltipTool tooltipTool = new NTooltipTool();

            NThinDiagramControl1.Controller.Tools.Add(tooltipTool);

            NPostbackTool postbackTool = new NPostbackTool();

//          postbackTool.PostbackOnlyOnInteractiveItems = PostbackOnlyOnInteractiveItemsCheckBox.Checked;
            NThinDiagramControl1.Controller.Tools.Add(postbackTool);
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!NThinChartControl1.Initialized)
            {
                // enable jittering (full scene antialiasing)
                NThinChartControl1.BackgroundStyle.FrameStyle.Visible = false;
                NThinChartControl1.Settings.JitterMode = JitterMode.Enabled;

                // set a chart title
                NLabel title = NThinChartControl1.Labels.AddHeader("Image Map Tools<br/>Tooltip, Browser Redirect, Cursor Change");
                title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
                title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
                title.TextStyle.TextFormat       = TextFormat.XML;

                // setup the chart
                NChart chart = NThinChartControl1.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(42, "Chart"));
                bar.AddDataPoint(new NDataPoint(56, "Diagram"));
                bar.AddDataPoint(new NDataPoint(12, "Gauges"));
                bar.AddDataPoint(new NDataPoint(23, "Maps"));

                // 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, NThinChartControl1, chart, title, NThinChartControl1.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 Chart Gallery", CursorType.Hand);
                interactivityStyle.UrlLink.OpenInNewWindow = true;
                interactivityStyle.UrlLink.Url             = "https://www.nevron.com/products-dot-net-chart-gallery-charting-types-bar-chart.aspx";
                bar.InteractivityStyles[0] = interactivityStyle;

                interactivityStyle = new NInteractivityStyle("Click here to jump to Diagram Gallery", CursorType.Hand);
                interactivityStyle.UrlLink.OpenInNewWindow = true;
                interactivityStyle.UrlLink.Url             = "https://www.nevron.com/products-dot-net-diagram-gallery-flow-and-organization-charts-flow-charts.aspx";
                bar.InteractivityStyles[1] = interactivityStyle;

                interactivityStyle = new NInteractivityStyle("Click here to jump to Gauge Gallery", CursorType.Hand);
                interactivityStyle.UrlLink.OpenInNewWindow = true;
                interactivityStyle.UrlLink.Url             = "https://www.nevron.com/products-dot-net-chart-gallery-gauges-radial-gauge.aspx";
                bar.InteractivityStyles[2] = interactivityStyle;

                interactivityStyle = new NInteractivityStyle("Click here to jump to Maps Gallery", CursorType.Hand);
                interactivityStyle.UrlLink.OpenInNewWindow = true;
                interactivityStyle.UrlLink.Url             = "https://www.nevron.com/products-dot-net-diagram-gallery-maps-general-maps.aspx";
                bar.InteractivityStyles[3] = interactivityStyle;
                NThinChartControl1.Controller.SetActivePanel(chart);
            }

            NThinChartControl1.Controller.Tools.Clear();

            if (EnableBrowserRedirectCheckBox.Checked)
            {
                NThinChartControl1.Controller.Tools.Add(new NBrowserRedirectTool());
            }

            if (EnableTooltipsCheckBox.Checked)
            {
                NTooltipTool tooltipTool = new NTooltipTool();
                tooltipTool.FollowMouse = true;
                NThinChartControl1.Controller.Tools.Add(tooltipTool);
            }

            if (EnableCursorChangeCheckBox.Checked)
            {
                NThinChartControl1.Controller.Tools.Add(new NCursorTool());
            }

            NThinChartControl1.Controller.Tools.Add(new NTrackballTool());
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // begin view init
            base.DefaultGridOrigin   = new NPointF(30, 30);
            base.DefaultGridCellSize = new NSizeF(100, 50);
            base.DefaultGridSpacing  = new NSizeF(50, 40);

            NDrawingDocument document = NThinDiagramControl1.Document;

            if (!NThinDiagramControl1.Initialized)
            {
                NThinDiagramControl1.View.Layout = CanvasLayout.Fit;
                // add the client mouse event tool
                NThinDiagramControl1.Controller.Tools.Add(new NPostbackTool());

                document.BeginInit();

                document.BackgroundStyle.FrameStyle.Visible = false;
                document.AutoBoundsPadding = new Nevron.Diagram.NMargins(10f, 10f, 10f, 10f);
                document.Style.FillStyle   = new NColorFillStyle(Color.White);

                NBasicShapesFactory factory = new NBasicShapesFactory(document);

                NShape outerCircle = factory.CreateShape(BasicShapes.Circle);
                outerCircle.Bounds = new NRectangleF(0f, 0f, 200f, 200f);
                document.ActiveLayer.AddChild(outerCircle);

                NShape rect = factory.CreateShape(BasicShapes.Rectangle);
                rect.Bounds                   = new NRectangleF(42f, 42f, 50f, 50f);
                rect.Style.FillStyle          = new NColorFillStyle(Color.LightBlue);
                rect.Style.InteractivityStyle = CreateInteractivityStyle("Rectangle", @"http://en.wikipedia.org/wiki/Rectangle");
                rect.Tag = true;
                document.ActiveLayer.AddChild(rect);

                NShape triangle = factory.CreateShape(BasicShapes.Triangle);
                triangle.Bounds                   = new NRectangleF(121f, 57f, 60f, 55f);
                triangle.Style.FillStyle          = new NColorFillStyle(Color.LightBlue);
                triangle.Style.InteractivityStyle = CreateInteractivityStyle("Triangle", @"http://en.wikipedia.org/wiki/Triangle");
                triangle.Tag = true;
                document.ActiveLayer.AddChild(triangle);

                NShape pentagon = factory.CreateShape(BasicShapes.Pentagon);
                pentagon.Bounds                   = new NRectangleF(60f, 120f, 54f, 50f);
                pentagon.Style.FillStyle          = new NColorFillStyle(Color.LightBlue);
                pentagon.Style.InteractivityStyle = CreateInteractivityStyle("Pentagon", @"http://en.wikipedia.org/wiki/Pentagon");
                pentagon.Tag = true;
                document.ActiveLayer.AddChild(pentagon);

                document.SizeToContent();
                document.EndInit();

                // add tooltip, browser redirect and cursor tools
                NTooltipTool tooltipTool = new NTooltipTool();
                NThinDiagramControl1.Controller.Tools.Add(tooltipTool);

                NBrowserRedirectTool browserRedirectTool = new NBrowserRedirectTool();
                NThinDiagramControl1.Controller.Tools.Add(browserRedirectTool);

                NCursorTool cursorTool = new NCursorTool();
                NThinDiagramControl1.Controller.Tools.Add(cursorTool);

                // configure the toolbar
                NThinDiagramControl1.Toolbar.Items.Add(new NToolbarButton(new NToggleTooltipToolAction()));
                NThinDiagramControl1.Toolbar.Items.Add(new NToolbarButton(new NToggleBrowserRedirectToolAction()));
                NThinDiagramControl1.Toolbar.Items.Add(new NToolbarButton(new NToggleCursorToolAction()));
            }
        }
        public override void Initialize(NThinChartControl control)
        {
            // enable jittering (full scene antialiasing)
            control.BackgroundStyle.FrameStyle.Visible = false;
            control.Settings.JitterMode = JitterMode.Enabled;

            // set a chart title
            NLabel title = control.Labels.AddHeader("Interactivity Tools<br/>Tooltip, Browser Redirect, Cursor Change");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
            title.TextStyle.TextFormat       = TextFormat.XML;

            // setup the chart
            NChart chart = control.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(42, "Chart"));
            bar.AddDataPoint(new NDataPoint(56, "Diagram"));
            bar.AddDataPoint(new NDataPoint(12, "Gauges"));
            bar.AddDataPoint(new NDataPoint(23, "Maps"));

            // 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, control, chart, title, control.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 Chart Gallery", CursorType.Hand);

            interactivityStyle.UrlLink.OpenInNewWindow = true;
            interactivityStyle.UrlLink.Url             = "http://www.nevron.com/Gallery.ChartFor.NET.ChartTypes.BarChartGallery.aspx";
            bar.InteractivityStyles[0] = interactivityStyle;

            interactivityStyle = new NInteractivityStyle("Click here to jump to Diagram Gallery", CursorType.Hand);
            interactivityStyle.UrlLink.OpenInNewWindow = true;
            interactivityStyle.UrlLink.Url             = "http://www.nevron.com/Gallery.DiagramFor.NET.FlowAndOrganizationCharts.Flowcharts.aspx";
            bar.InteractivityStyles[1] = interactivityStyle;

            interactivityStyle = new NInteractivityStyle("Click here to jump to Gauge Gallery", CursorType.Hand);
            interactivityStyle.UrlLink.OpenInNewWindow = true;
            interactivityStyle.UrlLink.Url             = "http://www.nevron.com/Gallery.ChartFor.NET.Gauges.RadialGaugeGallery.aspx";
            bar.InteractivityStyles[2] = interactivityStyle;

            interactivityStyle = new NInteractivityStyle("Click here to jump to Maps Gallery", CursorType.Hand);
            interactivityStyle.UrlLink.OpenInNewWindow = true;
            interactivityStyle.UrlLink.Url             = "http://www.nevron.com/Gallery.DiagramFor.NET.Maps.MapProjections.aspx";
            bar.InteractivityStyles[3] = interactivityStyle;

            control.Controller.Tools.Add(new NTooltipTool());
            control.Controller.Tools.Add(new NBrowserRedirectTool());
            control.Controller.Tools.Add(new NCursorTool());

            control.Controller.Tools.Clear();

            // add browser redirect tool
            control.Controller.Tools.Add(new NBrowserRedirectTool());

            // add tooltip tool that follows the mouse
            NTooltipTool tooltipTool = new NTooltipTool();

            tooltipTool.FollowMouse = true;
            control.Controller.Tools.Add(tooltipTool);

            // add a cursor change tool
            control.Controller.Tools.Add(new NCursorTool());
        }