I would like to have on the six chartareas on the image 6 scrollbars i have genrate it but on the srollbar apears a button if i pressed the button the scrollbare hide but i do not want this button can anyone help me with this Problem please.
the unintentional Button1
private void makeChartsScrollable(Chart chart) {
chart.ChartAreas[3].AxisX.ScrollBar.Enabled = true;
// chart.ChartAreas[3].CursorX.IsUserEnabled = false;
// chart.ChartAreas[3].CursorX.IsUserSelectionEnabled = false;
// chart.ChartAreas[2].AxisX.ScaleView.Zoomable = false;
// chart.ChartAreas[2].AxisX.IsLabelAutoFit = true;
// chart.ChartAreas[2].AxisX.ScaleView.Position = 0;
// chart.ChartAreas[2].AxisX.ScaleView.Size = 23;
//chart.ChartAreas[3].AxisX.
chart.ChartAreas[3].AxisX.ScaleView.Zoom(0, 8);
chart.ChartAreas[3].AxisX.ScaleView.MinSize = 0;
chart.ChartAreas[3].AxisX.ScrollBar.IsPositionedInside = true;
chart.ChartAreas[3].AxisX.ScrollBar.Size = 23;
chart.ChartAreas[3].AxisX.ScrollBar.ButtonColor = Color.Silver;
chart.ChartAreas[3].AxisX.ScrollBar.LineColor = Color.Black;
/*
chart.ChartAreas[3].AxisX2.ScaleView.Zoomable = false;
chart.ChartAreas[3].AxisX2.ScrollBar.Enabled = true;
chart.ChartAreas[3].AxisX2.ScaleView.Position = 0;
chart.ChartAreas[3].AxisX2.IsLabelAutoFit = false;
chart.ChartAreas[3].AxisX2.ScaleView.Size = 23;
chart.ChartAreas[3].AxisX2.ScrollBar.ButtonColor = Color.Silver;
chart.ChartAreas[3].AxisX2.ScrollBar.LineColor = Color.Black;*/
}
Related
There is a program and its form, onto which images are loaded from the network. To change the image, I press button.click. However, there is one moment, namely: after clicking on the button, in theory, the next image should appear instantly (the speed is similar to that of flipping through photos in the "Windows photo viewer")) only with very rare delays). And it appears, but with a delay of one or about one second, and in theory it shouldn't be like this, and there are similar programs of mine, on which it just happens as I need it, without delays! How and is it possible in this code to speed up the rendering / appearance of images on picturebox.image and other elements that appear along with it? Perhaps even in the code there are elements that should not be at all and you can throw them out of the code:
private void ricVision()
{
try
{
if (!this.locker && (this.waitVision.Count > 0))
{
this.textBox2.Focus();
this.locker = true;
string[] strArray = this.waitVision[0];
if (strArray[9].ToString() != "-")
{
this.textBox2.Text = strArray[9].ToString();
}
int num = Convert.ToInt32(strArray[0].ToString());
int num2 = Convert.ToInt32(strArray[1].ToString());
int index = Convert.ToInt32(strArray[6].ToString());
this.visionType = strArray[2].ToString();
this.Registor = strArray[3].ToString();
this.WordsTwo = strArray[4].ToString();
this.label7.Text = this.Registor;
this.label8.Text = strArray[4].ToString();
this.label16.Text = strArray[10].ToString();
{
if (label16.Text.Length > 5)
label16.Text = label16.Text.Substring(0, 5);
};
this.label19.Text = strArray[12].ToString();
this.label21.Text = this.BASE64;
this.label23.Text = strArray[13].ToString();
this.BASE64 = strArray[14].ToString();
DoubleBuffered = true;
if (label7.Text == "False")
{
dataGridView1.Rows[index].Cells[1].Style.BackColor = Color.Empty;
DoubleBuffered = true;
}
else if (label7.Text == "True")
{
dataGridView1.Rows[index].Cells[1].Style.BackColor = Color.Tomato;
DoubleBuffered = true;
}
if (label8.Text == "False")
{
dataGridView1.Rows[index].Cells[3].Style.BackColor = Color.Empty;
DoubleBuffered = true;
}
else if (label8.Text == "True")
{
dataGridView1.Rows[index].Cells[3].Style.BackColor = Color.Tomato;
DoubleBuffered = true;
}
this.label10.Text = this.visionType;
this.pictureBox1.Width = num;
this.pictureBox1.Height = num2;
this.panel2.Visible = true;
{
this.label13.Text = this.dataGridView1.Rows[index].Cells[3].Value.ToString();
if (double.Parse(label13.Text) < 0)
{
panel2.BackColor = Color.GreenYellow;
this.dataGridView1.Rows[index].DefaultCellStyle.BackColor = Color.GreenYellow;
if (label8.Text == "True")
{
panel2.BackColor = Color.RoyalBlue;
dataGridView1.Rows[index].DefaultCellStyle.BackColor = Color.RoyalBlue;
label13.ForeColor = Color.RoyalBlue;
DoubleBuffered = true;
}
}
else
{
panel2.BackColor = Color.Gainsboro;
if (label8.Text == "False")
{
panel2.BackColor = Color.Gainsboro;
dataGridView1.Rows[index].DefaultCellStyle.BackColor = Color.Gold;
label13.ForeColor = Color.Green;
DoubleBuffered = true;
}
}
};
string s = strArray[5].ToString().Substring(0, strArray[5].ToString().Length - 9).Replace(#"\/", "/");
this.visionId = strArray[5].ToString().Substring(strArray[5].ToString().Length - 9);
this.visionThread = Convert.ToInt32(strArray[6]);
this.label12.Text = strArray[7].ToString();
Bitmap bitmap = new Bitmap(this.pictureBox1.Width, this.pictureBox1.Height);
string path = "";
this.pictureBox1.DrawToBitmap(bitmap, this.pictureBox1.ClientRectangle);
this.pictureBox1.Refresh();
DoubleBuffered = true;
this.ResumeLayout(false);
Form1 form = (Form1)Application.OpenForms[0];
this.ActiveControl = textBox2;
TopMost = true;
TopLevel = true;
textBox2.Select();
form.Activate();
form.Focus();
this.showCaptcha();
this.timer1.Enabled = true;
ImageFormat bmp = null;
Graphics gdi = Graphics.FromImage(bitmap);
using (MemoryStream stream = new MemoryStream(Convert.FromBase64String(s)))
{
this.pictureBox1.Image = Image.FromStream(stream);
}
}
}
catch (Exception exception)
{
MessageBox.Show(exception.ToString());
}
}
I'm currently working on a file explorer.
Now I want to change the ForeColor of one label.
But as soon as I add the code for it everything else disappears.
lblpath.ForeColor = ColorTranslator.FromHtml("00ff00");
When I start the application Form1 will just be empty.
I don't know if I should post my code, because it's quite a bit and I don't know which parts would be relevant...
EDIT:
Method where I use this code:
private void initiateGUI()
{
this.Text = "Explorer";
this.BackColor = ColorTranslator.FromHtml("#1a1a1a");
oneup = new Button();
oneup.Location = new Point(455, 12);
oneup.Parent = this;
oneup.Visible = true;
oneup.MouseClick += oneup_click;
oneup.Text = "UP";
oneup.Width = 40;
oneup.Height = 20;
cmdrefresh = new Button();
cmdrefresh.Location = new Point(500, 12);
cmdrefresh.Parent = this;
cmdrefresh.Visible = true;
cmdrefresh.MouseClick += refresh_click;
cmdrefresh.Text = "Refresh";
cmdrefresh.Width = 55;
cmdrefresh.Height = 20;
lblfolder.Location = new Point(475, 39);
lblfolder.Font = font;
//lblfolder.ForeColor = Color.Blue;
lblfolder.Parent = this;
lblfolder.Height = 13;
lblfolder.Text = "Folders";
lblfile.Location = new Point(12, 39);
lblfile.Font = font;
//lblfile.ForeColor = ColorTranslator.FromHtml("#00ff00");
lblfile.Parent = this;
lblfile.Height = 13;
lblfile.Text = "Files";
lblpath.Location = new Point(12, 15);
lblpath.Font = font;
lblpath.ForeColor = ColorTranslator.FromHtml("#00ff00");
lblpath.Parent = this;
lblpath.Height = 13;
lblpath.Width = 30;
lblpath.Text = "Path";
scrollfolder.AutoScroll = false;
scrollfolder.HorizontalScroll.Enabled = false;
scrollfolder.HorizontalScroll.Visible = false;
scrollfolder.HorizontalScroll.Maximum = 0;
scrollfolder.AutoScroll = true;
scrollfolder.Parent = this;
scrollfolder.Height = 390;
scrollfolder.Width = 220;
scrollfolder.Location = new Point(x2 - 10, y - 10);
scrollfiles.AutoScroll = false;
scrollfiles.HorizontalScroll.Enabled = false;
scrollfiles.HorizontalScroll.Visible = false;
scrollfiles.HorizontalScroll.Maximum = 0;
scrollfiles.AutoScroll = true;
scrollfiles.Parent = this;
scrollfiles.Height = 390;
scrollfiles.Width = 420;
scrollfiles.Location = new Point(x - 10, y - 10);
}
You are missing # in color definition. It should be:
lblpath.ForeColor = ColorTranslator.FromHtml("#00ff00");
ColorTranslator.FromHtml will throw exception if "00ff00" used
Why don't you use the designer to set the colour?
Where did you add this code, to the constructor? Most likely, the statement throws an exception before InitializeComponents gets a chance to run - and if you added the code to the constructor, before InitializeComponents, it's very likely that lblpath doesn't exist yet, so you're getting NullReferenceException. Try enabling "break on all exceptions" in the debugger, it's very handy for debugging Winforms applications, since the error will no longer be swallowed.
Use the designer to set the colour, and you'll be fine.
I have a C# program that reads in data from an Arduino Mega four times a second and displays the data in two charts, each chart has two sets of data. After a couple of hours of running the data starts to lag. I can watch the program grow in size over time. I believe the problem is the charts are showing snapshot of 1 minute on each chart but the program just keeps collecting data and creating the memory leak issue. Is there a way to limit the data collection to a minute or two and dump the old data?
This is my first C# program I have ever written and I'm an old fart (62) and suffer from CRS "Can't Remember Sh_t".
Any help would be greatly appreciated.
Bryan
Program data collection
// load the main form and sets up the charts
private void TelemetryForm_Load(object sender, EventArgs e)
{
intensityChart.ChartAreas.Add("area");
intensityChart.Legends.Add("INTENSITY");
intensityChart.Legends.Add("I SENSE");
intensityChart.Series.Add("INTENSITY");
intensityChart.Series.Add("I SENSE");
intensityChart.Legends["INTENSITY"].Position.Auto = false;
intensityChart.Legends["INTENSITY"].Position.Height = 10;
intensityChart.Legends["INTENSITY"].Position.Width = 50;
intensityChart.Legends["INTENSITY"].Position.X = 20;
intensityChart.Legends["INTENSITY"].Position.Y = 0;
intensityChart.Legends["I SENSE"].Position.Auto = false;
intensityChart.Legends["I SENSE"].Position.Height = 10;
intensityChart.Legends["I SENSE"].Position.Width = 50;
intensityChart.Legends["I SENSE"].Position.X = 20;
intensityChart.Legends["I SENSE"].Position.Y = 0;
toolCapChart.ChartAreas.Add("area2");
toolCapChart.Series.Add("CAPACITOR VOLTAGE");
toolCapChart.Series.Add("TOOL VOLTAGE");
toolCapChart.Legends.Add("CAPACITOR VOLTAGE");
toolCapChart.Legends.Add("TOOL VOLTAGE");
toolCapChart.Legends["TOOL VOLTAGE"].Position.Auto = false;
toolCapChart.Legends["TOOL VOLTAGE"].Position.Height = 10;
toolCapChart.Legends["TOOL VOLTAGE"].Position.Width = 50;
toolCapChart.Legends["TOOL VOLTAGE"].Position.X = 20;
toolCapChart.Legends["TOOL VOLTAGE"].Position.Y = 0;
toolCapChart.Legends["CAPACITOR VOLTAGE"].Position.Auto = false;
toolCapChart.Legends["CAPACITOR VOLTAGE"].Position.Height = 10;
toolCapChart.Legends["CAPACITOR VOLTAGE"].Position.Width = 50;
toolCapChart.Legends["CAPACITOR VOLTAGE"].Position.X = 20;
toolCapChart.Legends["CAPACITOR VOLTAGE"].Position.Y = 0;
timer1.Enabled = true;
timer1.Start();
}
// adds the data to the charts
public void chartRead(Double timeofday)
{
Double x = timeofday;
Double z = 1 * timeofday;
Double y = 6 * timeofday;
int charttime = 240;
FontHeight = -1;
intensityChart.ChartAreas["area"].Position.Auto = false;
intensityChart.ChartAreas["area"].Position.Y = 8;
intensityChart.Series["INTENSITY"].Points.AddXY(DateTime.Now.ToLongTimeString(), mic_out);
intensityChart.Series["I SENSE"].Points.AddXY(DateTime.Now.ToLongTimeString(), i_sense);
intensityChart.Series["INTENSITY"].LegendText = "INTENSITY";
intensityChart.Series["I SENSE"].LegendText = "I SENSE";
intensityChart.Series["INTENSITY"].Color = Color.Blue;
intensityChart.Series["I SENSE"].Color = Color.Orange;
intensityChart.Series["INTENSITY"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
intensityChart.Series["I SENSE"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
intensityChart.Series["I SENSE"].YAxisType = System.Windows.Forms.DataVisualization.Charting.AxisType.Secondary;
intensityChart.ChartAreas["area"].AxisX.Minimum = intensityChart.ChartAreas["area"].AxisX.Maximum - charttime;
intensityChart.ChartAreas["area"].AxisX.Interval =charttime/6;
intensityChart.ChartAreas["area"].AxisY.Minimum = 0;
intensityChart.ChartAreas["area"].AxisY.Maximum = 100;
intensityChart.ChartAreas["area"].AxisY.Interval = 10;
intensityChart.ChartAreas["area"].AxisY.MajorTickMark.Enabled = false;
intensityChart.ChartAreas["area"].AxisY.MajorTickMark.Interval = 5;
intensityChart.ChartAreas["area"].AxisY2.MajorTickMark.Enabled = false;
intensityChart.ChartAreas["area"].AxisY2.MajorTickMark.Interval = 5;
intensityChart.ChartAreas["area"].AxisX.MinorTickMark.Interval = 5;
intensityChart.ChartAreas["area"].AxisX.MinorTickMark.Enabled = true;
intensityChart.ChartAreas["area"].AxisY.MinorTickMark.Interval = 5;
intensityChart.ChartAreas["area"].AxisY.MinorTickMark.Enabled = true;
intensityChart.ChartAreas["area"].AxisY2.Minimum = 0;
intensityChart.ChartAreas["area"].AxisY2.Maximum = isenseYscale;
intensityChart.ChartAreas["area"].AxisY2.Interval = isenseYscale/10;
intensityChart.ChartAreas["area"].AxisX2.MinorTickMark.Interval = 5;
intensityChart.ChartAreas["area"].AxisX2.MinorTickMark.Enabled = true;
intensityChart.ChartAreas["area"].AxisY2.MinorTickMark.Interval = 1;
intensityChart.ChartAreas["area"].AxisY2.MinorTickMark.Enabled = true;
intensityChart.ChartAreas["area"].AxisY.Title = "INTENSITY";
intensityChart.ChartAreas["area"].AxisY2.Title = "I SENSE";
toolCapChart.ChartAreas["area2"].Position.Auto = false;
toolCapChart.ChartAreas["area2"].Position.Y = 8;
toolCapChart.Series["TOOL VOLTAGE"].Color = Color.Red;
toolCapChart.Series["CAPACITOR VOLTAGE"].Color = Color.Green;
toolCapChart.Series["CAPACITOR VOLTAGE"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
toolCapChart.Series["TOOL VOLTAGE"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
toolCapChart.Series["TOOL VOLTAGE"].YAxisType = System.Windows.Forms.DataVisualization.Charting.AxisType.Secondary;
toolCapChart.Series["TOOL VOLTAGE"].LegendText = "TOOL VOLTAGE";
toolCapChart.Series["CAPACITOR VOLTAGE"].LegendText = "CAPACITOR VOLTAGE";
toolCapChart.Series["CAPACITOR VOLTAGE"].Points.AddXY(DateTime.Now.ToLongTimeString(), hv_sense);
toolCapChart.Series["TOOL VOLTAGE"].Points.AddXY(DateTime.Now.ToLongTimeString(), tool_vin);
toolCapChart.ChartAreas["area2"].AxisX.Minimum = toolCapChart.ChartAreas["area2"].AxisX.Maximum - charttime;
toolCapChart.ChartAreas["area2"].AxisY2.Minimum = 0;
toolCapChart.ChartAreas["area2"].AxisY2.Maximum = toolVoltageChart;
toolCapChart.ChartAreas["area2"].AxisY.Minimum = 0;
toolCapChart.ChartAreas["area2"].AxisY.Maximum =hvSenseChartYScale;
toolCapChart.ChartAreas["area2"].AxisY2.MinorTickMark.Interval = toolVoltageChart/25;
toolCapChart.ChartAreas["area2"].AxisY2.MinorTickMark.Enabled = true;
toolCapChart.ChartAreas["area2"].AxisY2.MajorTickMark.Interval = 100;
toolCapChart.ChartAreas["area2"].AxisY2.MajorTickMark.Enabled = false;
toolCapChart.ChartAreas["area2"].AxisX.Interval = charttime/6;
toolCapChart.ChartAreas["area2"].AxisX.MinorTickMark.Interval = 5;
toolCapChart.ChartAreas["area2"].AxisX.MinorTickMark.Enabled = true;
toolCapChart.ChartAreas["area2"].AxisY.MinorTickMark.Interval = hvSenseChartYScale/25;
toolCapChart.ChartAreas["area2"].AxisY.MinorTickMark.Enabled = true;
toolCapChart.ChartAreas["area2"].AxisY.MajorTickMark.Interval = 1000;
toolCapChart.ChartAreas["area2"].AxisY.MajorTickMark.Enabled = false;
toolCapChart.ChartAreas["area2"].AxisY2.Title = "TOOL VOLTAGE";
toolCapChart.ChartAreas["area2"].AxisY.Title = "CAPACITOR VOLTAGE";
capVoltageAngularGauge.Value = hv_sense;
pulseIntensityLinearGauge.Value = mic_ph_out;
pulseIntensityLinearGauge.Max = mic_ph_scaling;
After calling series.Points.AddXY(...) try calling series.Points.RemoveAt(0) if the series has more points than can be displayed. This effectively pops the oldest each time a new one comes in.
if(toolCapChart.Series["TOOL VOLTAGE"].Points.Count > maxSize)
toolCapChart.Series["TOOL VOLTAGE"].Points.RemoveAt(0);
I have 2 bar series in a tee chart. One is a percent value between 0 and 100 and uses the left axis. The other is a temperature, uses the right axis, and the range of possible values is between -40F and 160F.
I would like both bars to start at the bottom axis. I thought that the UseOrigin and Origin properties of the series would do this but apparently it doesn't work.
Below is my code:
chartTank = new TChart();
chartTank.Axes.Left.Grid.Visible = false;
chartTank.Axes.Right.Grid.Visible = false;
chartTank.Axes.Right.Maximum = 160.0;
chartTank.Axes.Right.Minimum = -40;
chartTank.Axes.Right.Increment = 40;
chartTank.Axes.Right.Automatic = false;
chartTank.Axes.Right.AutomaticMinimum = false;
chartTank.Axes.Right.AutomaticMaximum = false;
chartTank.Aspect.View3D = false;
chartTank.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
chartTank.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
chartTank.Axes.Left.Grid.Visible = false;
chartTank.Axes.Bottom.GridCentered = false;
chartTank.Axes.Bottom.Ticks.Visible = false;
chartTank.Axes.Left.Automatic = false;
chartTank.Axes.Left.Minimum = 0;
chartTank.Axes.Left.Maximum = 100;
chartTank.Axes.Right.Visible = true;
var barProduct = new Steema.TeeChart.Styles.Bar();
barProduct.MultiBar = MultiBars.Stacked;
barProduct.Color = Color.Green;
barProduct.Marks.Visible = false;
barProduct.Title = "% Vol";
barProduct.ShowInLegend = true;
chartTank.Series.Add(barProduct);
var barTemperature = new Steema.TeeChart.Styles.Bar();
barTemperature.MultiBar = MultiBars.None;
barTemperature.Color = Color.FromArgb(153, 74, 11);
barTemperature.Marks.Visible = false;
barTemperature.VertAxis = VerticalAxis.Right;
barTemperature.UseOrigin = true;
barTemperature.Origin = -40;
barTemperature.Title = "Temperature";
barTemperature.ShowInLegend = true;
chartTank.Series.Add(barTemperature);
Controls.Add(chartTank);
Here is the result:
I am using TeeChart 2014 4.1 for .NET running on windows CE 6.0
The following code:
private void InitializeChart()
{
tChart1.Axes.Right.Grid.Visible = false;
tChart1.Axes.Right.Maximum = 160.0;
tChart1.Axes.Right.Minimum = -40;
tChart1.Axes.Right.Increment = 40;
tChart1.Axes.Right.Automatic = false;
tChart1.Axes.Right.AutomaticMinimum = false;
tChart1.Axes.Right.AutomaticMaximum = false;
tChart1.Aspect.View3D = false;
tChart1.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Axes.Left.Grid.Visible = false;
tChart1.Axes.Bottom.Grid.Centered = false;
tChart1.Axes.Bottom.Ticks.Visible = false;
tChart1.Axes.Left.Automatic = false;
tChart1.Axes.Left.Minimum = 0;
tChart1.Axes.Left.Maximum = 100;
tChart1.Axes.Right.Visible = true;
var barProduct = new Steema.TeeChart.Styles.Bar();
barProduct.MultiBar = MultiBars.Side;
barProduct.Color = Color.Green;
barProduct.Marks.Visible = false;
barProduct.Title = "% Vol";
barProduct.ShowInLegend = true;
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
barProduct.Add(rnd.Next(0, 100));
}
tChart1.Series.Add(barProduct);
var barTemperature = new Steema.TeeChart.Styles.Bar();
barTemperature.MultiBar = MultiBars.Side;
barTemperature.Color = Color.FromArgb(153, 74, 11);
barTemperature.Marks.Visible = false;
barTemperature.VertAxis = VerticalAxis.Right;
barTemperature.UseOrigin = true;
barTemperature.Origin = -40;
barTemperature.Title = "Temperature";
barTemperature.ShowInLegend = true;
for (int i = 0; i < 10; i++)
{
barTemperature.Add(rnd.Next(-40, 160));
}
tChart1.Series.Add(barTemperature);
tChart1.Panel.Gradient.Visible = false;
tChart1.Walls.Back.Gradient.Visible = false;
tChart1.Panel.Color = Color.White;
tChart1.Walls.Back.Color = Color.White;
}
gives me the following chart:
Do you get the same results at your end?
I have an application with Chart control that dynamic updated with data via timer:
Series series;
MyObject obj...
series = new Series();
chart1.Series.Add(series);
//chart1.Legends.Add(new Legend("DifferentLegend"));
//chart1.Legends["DifferentLegend"].DockedToChartArea = "Default";
//chart1.Series["Series1"].Legend = "DifferentLegend";
//chart1.Series["Series1"].IsVisibleInLegend = true;
series.Color = Color.Blue;
series.ChartType = SeriesChartType.Line;
series.BorderWidth = 3;
chart1.Series.Add(series);
//chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.White;
//chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.White;
chart1.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
chart1.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
chart1.ChartAreas[0].AxisX.Maximum = 4;
chart1.ChartAreas[0].AxisX.Interval = 1;
chart1.ChartAreas[0].AxisX.IsStartedFromZero = true;
chart1.ChartAreas[0].AxisX.IntervalOffsetType = DateTimeIntervalType.Number;
Timer tick:
private void chartTimer_Tick(object sender, EventArgs e)
{
series.Points.Add(obj.BitsPerSecond * 0.000001);
}
I want to change it style and remove the squares from the control:
How can I do that?
Try This:
chart1.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
chart1.ChartAreas[0].AxisX.MinorGrid.LineWidth = 0;
chart1.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
chart1.ChartAreas[0].AxisY.MinorGrid.LineWidth = 0;
To disable X-Axis Labels from the Chart :
chart1.ChartAreas[0].AxisX.LabelStyle.Enabled = false;
This then?
mainChart.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
mainChart.ChartAreas[0].AxisY.MajorGrid.Enabled = false;
mainChart.ChartAreas[0].AxisX.MinorGrid.Enabled = false;
mainChart.ChartAreas[0].AxisY.MinorGrid.Enabled = false;