Profile Picture

Set PlotArea Background Color

Posted By cho seongho 5 Years Ago
Author
Message
Nevron Support
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi Cho,
We just tested with this code and it was working - can you remove the interlace lines and check again - it can be that you have configured interlacing so that it covers the entire back plot area of the chart...

Best Regards,
Nevron Support Team



cho seongho
Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 15, Visits: 73

This is the code that I initialize.
The last line of code does not work.

[


 private void DyNevronChart_Load(object sender, EventArgs e)
        {
            m_chart = nChartControl1.Charts[0];


            DataLimit = 10000;
            DataDisplayRangeX = 100;


            MaxValueY = 0.0;
            MinValueY = 0.0;

            m_seriesTracking = true;
            m_chart.Margins = new NMarginsL(10, 20, 20, 10);
            m_chart.DockMode = PanelDockMode.Fill;
            m_chart.Axis(StandardAxis.Depth).Visible = false;
            m_chart.BoundsMode = BoundsMode.Stretch;

            m_chartTitleLabel = new NLabel();
            m_chartTitleLabel.Margins = new NMarginsL(0, 3, 0, 3);
            m_chartTitleLabel.DockMode = PanelDockMode.Top;
            m_chartTitleLabel.Visible = false;
            nChartControl1.Panels.Add(m_chartTitleLabel);
           

            m_legend = new NLegend();
            m_legend.SetPredefinedLegendStyle(PredefinedLegendStyle.TopRight);
            m_legend.Margins = new NMarginsL(10, 10, 10, 10);
            m_legend.Visible = true;
            nChartControl1.Panels.Add(m_legend);
            m_chart.DisplayOnLegend = m_legend;

            NCartesianChart cartesianChart = m_chart as NCartesianChart;
            cartesianChart.RangeSelections.Add(new NRangeSelection());
            nChartControl1.Controller.Tools.Add(new NAxisScrollTool());
           
            NDataPanTool dataPanTool = new NDataPanTool();
            dataPanTool.Drag += DataPanTool_OnPaning;
            dataPanTool.EndDrag += DataPanTool_EndPaning;
            nChartControl1.Controller.Tools.Add(dataPanTool);

            NDataZoomTool dataZoomTool = new NDataZoomTool();
            dataZoomTool.WheelZoomAtMouse = true;
            dataZoomTool.BeginDragMouseCommand = new NMouseCommand(MouseAction.Wheel, MouseButton.None, 0);
            nChartControl1.Controller.Tools.Add(dataZoomTool);
            nChartControl1.Controller.Selection.Add(cartesianChart);


            NLinearScaleConfigurator xLinearScale = new NLinearScaleConfigurator();
            xLinearScale.RoundToTickMax = false;
            xLinearScale.RoundToTickMin = false;
            xLinearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            xLinearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            xLinearScale.InflateViewRangeBegin = true;
            xLinearScale.InflateViewRangeEnd = true;
            NScaleStripStyle xInterlacedStrip = new NScaleStripStyle();
            xLinearScale.StripStyles.Add(xInterlacedStrip);
            m_chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = xLinearScale;

            m_chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = true;
            m_chart.Axis(StandardAxis.PrimaryX).ScrollBar.ResetButton.Visible = true;
            m_chart.Axis(StandardAxis.PrimaryX).ScrollBar.Reset += nChartControl1_ScrollReset;


            NLinearScaleConfigurator yLinearScale = new NLinearScaleConfigurator();
            yLinearScale.RoundToTickMax = false;
            yLinearScale.RoundToTickMin = false;
            yLinearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            yLinearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            NScaleStripStyle yInterlacedStrip = new NScaleStripStyle();
            yLinearScale.StripStyles.Add(yInterlacedStrip);
            m_chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = yLinearScale;

            m_chart.Wall(ChartWallType.Back).FillStyle = new NColorFillStyle(Color.BlueViolet); //NotWorking!!!!!!!!
        }



Nevron Support
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi Cho,

Can you post the complete code you test with for review?

Best Regards,
Nevron Support Team



cho seongho
Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 15, Visits: 73

Thank you for answer.But the source code you gave it is the same, but it does not change.Only the color of "NScaleStripStyle" is applied, and the background color appears as the default color.

Execution screen>
https://www.nevron.com/forum/uploads/images/e7e058e6-c64c-464e-9c23-370e.png



Nevron Support
This post has been flagged as an answer
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi Cho,

You need to change the color of back chart wall:
NChart chart = (NChart)nChartControl1.Charts[0];
chart.Wall(ChartWallType.Back).FillStyle = new NColorFillStyle(Color.Red);
Hope this helps - let us know if you meet any problems.

Best Regards,
Nevron Support Team



cho seongho
Question Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 15, Visits: 73
I'm basically using a 2D chart.I want to change the background color of PlotArea. However, when I run the code below, only the rest of the color changes except PlotArea.


nChartControl1.BackgroundStyle.FillStyle = new NColorFillStyle(Color.Black);
nChartControl1.Charts[0].BackgroundFillStyle = new NColorFillStyle(Color.Black);

Thank you for your help.



Similar Topics


Reading This Topic