I need to plot bit values (0 or 1) of a very large set of shorts, with bit 0 as empty space and bit 1 value as a filled bar. Is there any FastlineSeries equivalent for Bar series to handle such a large amount of data?
If no such series is available, can you please suggest an efficient series that simply plots different colors for the '0' value and '1' values? Its essentially similar to Welcome !\Chart styles\Statistical\Color Grid, but should be able to be used with the Fastlineseries on the same tchart object. It should be able to handle large amount of data.
Thanks,
FastlineSeries equivalent of Bar Series?
Re: FastlineSeries equivalent of Bar Series?
Hi asupriya,
If i understand well what you are trying to do, isn't the bar series the best looking series for this?
With null values for the "zeros":
Or with points also for the "zeros" as 0,5 to show them and giving a label to show them as a zero instead of 0,5:
Or maybe easier with the volume series:
If i understand well what you are trying to do, isn't the bar series the best looking series for this?
With null values for the "zeros":
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
Bar bar1 = new Bar(tChart1.Chart);
bar1.BarWidthPercent = 0;
bar1.Marks.Visible = false;
for (int i = 0; i < 500; i++)
{
if ((i % 20 == 0) || (i % 21 == 0) || (i % 22 == 0))
{
bar1.Add(); //the zeros
}
else
{
bar1.Add(1, Color.Blue); //the ones
}
}
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
Bar bar1 = new Bar(tChart1.Chart);
bar1.BarWidthPercent = 0;
bar1.Marks.Visible = false;
for (int i = 0; i < 500; i++)
{
if ((i % 20 == 0) || (i % 21 == 0) || (i % 22 == 0))
{
bar1.Add(0.5, "0", Color.Red); //the zeros
}
else
{
bar1.Add(1, "1", Color.Blue); //the ones
}
}
tChart1.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Text;
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
Volume volume1 = new Volume(tChart1.Chart);
volume1.Marks.Visible = false;
for (int i = 0; i < 500; i++)
{
if ((i % 20 == 0) || (i % 21 == 0) || (i % 22 == 0))
{
volume1.Add(0.5, "0", Color.Red); //the zeros
}
else
{
volume1.Add(1, "1", Color.Blue); //the ones
}
}
tChart1.Axes.Left.SetMinMax(0, 1.5);
tChart1.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Text;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: FastlineSeries equivalent of Bar Series?
Thanks for the hints. Out of all, volume series has acceptable performance with our data and thus is being used.
One related question is, how can i let the user change the color assignment for 0s and 1s? Users will be using this series in combination with fastlineseries. Legend.click event handles the line color, thickness, etc. editing stuff for fastlineseries. Similarly, when the series type is of volume series type, How can I have something similar editor interface for the volume series so that users can set what color bits with '0' take and what color '1's take.
Thanks for the help.
One related question is, how can i let the user change the color assignment for 0s and 1s? Users will be using this series in combination with fastlineseries. Legend.click event handles the line color, thickness, etc. editing stuff for fastlineseries. Similarly, when the series type is of volume series type, How can I have something similar editor interface for the volume series so that users can set what color bits with '0' take and what color '1's take.
Thanks for the help.
Re: FastlineSeries equivalent of Bar Series?
Hi asupriya,
You could have two Color variables and a form with two buttons, one for each color, show the color palette when any of them are pressed, and loop your into your series and changing the ValueColor of all the items with the YValue that matches the pressed button.
You could have two Color variables and a form with two buttons, one for each color, show the color palette when any of them are pressed, and loop your into your series and changing the ValueColor of all the items with the YValue that matches the pressed button.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: FastlineSeries equivalent of Bar Series?
1. That will be extremely slow process as I have more than 18000 values in a series. Is there a better alternate to looping through the YValues?changing the ValueColor of all the items with the YValue that matches the pressed button
2. Is there a way to get equivalent result of fastlineseries1.drawAllPoints=False for the volume series?
3. If the volume series is drawn over already existing FastLineSeries on a graph display, How can I make sure that fastlineseries ALWAYS drawn over the volume series so that the line draws are visible over the volume series. There can be more than one fast line series on a graph display. I can use tChart1.Series.Exchange, but it works with only two series at a time. How to make sure that volume series is always at the bottom layer of all other series on a given graph display?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: FastlineSeries equivalent of Bar Series?
Hi asupriya,
If you are using a FastLine series and a Volume series with same values you can use the same index for both series.
Yes, you can do someting like this:1. That will be extremely slow process as I have more than 18000 values in a series. Is there a better alternate to looping through the YValues?
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Volume volume1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
volume1 = new Steema.TeeChart.Styles.Volume(tChart1.Chart);
volume1.FillSampleValues();
tChart1.ClickLegend += new MouseEventHandler(tChart1_ClickLegend);
}
void tChart1_ClickLegend(object sender, MouseEventArgs e)
{
int index = tChart1.Legend.Clicked(e.X, e.Y);
if (index != -1)
{
volume1.Colors[index] = Color.Red;
volume1.Repaint();
}
}
Yes, something similar can be achieved with the DownSampling function demoed at All Features\Welcome !\Functions\Extended\Reducing number of points2. Is there a way to get equivalent result of fastlineseries1.drawAllPoints=False for the volume series?
You can do something as in the code snippet below so that the FastLine series will always be the top-most series in the chart.3. If the volume series is drawn over already existing FastLineSeries on a graph display, How can I make sure that fastlineseries ALWAYS drawn over the volume series so that the line draws are visible over the volume series. There can be more than one fast line series on a graph display. I can use tChart1.Series.Exchange, but it works with only two series at a time. How to make sure that volume series is always at the bottom layer of all other series on a given graph display?
Code: Select all
Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
fastLine1.FillSampleValues();
Steema.TeeChart.Styles.Volume volume1 = new Steema.TeeChart.Styles.Volume(tChart1.Chart);
volume1.FillSampleValues();
tChart1.Series.Exchange(0, tChart1.Series.Count-1);
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |