fix increment
fix increment
Hi
It could be possible to fix (in the drawing) the increment in the right axe?
I need that each increment are equal in pixels, or points, etc.
I need to put a tabular data next to the graph, each row of the tabular data is one increment in the right axe.
Thanks
It could be possible to fix (in the drawing) the increment in the right axe?
I need that each increment are equal in pixels, or points, etc.
I need to put a tabular data next to the graph, each row of the tabular data is one increment in the right axe.
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: fix increment
Hi tenaris,
Yes, you can use axis Increment property. Please read tutorial 4, which can be found at TeeChart's program group, for further information on axis settings.
Yes, you can use axis Increment property. Please read tutorial 4, which can be found at TeeChart's program group, for further information on axis settings.
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 |
Re: fix increment
Thanks for reply.
But that I need, is set the same distance between each ticks in pixels.
I want to create a graph dinamically next to a tabular data, and I need that each row of the tabular data are in the same line at the graphic ticks.
.......................Tabular Data.............................................................Graph
Name............Value a........Value b
element 1.......2...............5................................1---| #########
.......................................................................X |
element 2.......4...............2.................................2--| ###########
.........................................................................|
element 3.......1...............2.................................3--| ###########
.........................................................................|
element 4.......3...............4................................4---| #######
...................................................................... --|
...................................................................... ---|
eleemnt n..........................................................n---| ##########
.......................................................................... __________________________________________________________
...................................................................................|.........|...........|..........|..........|...........|............|
(the dots are blanks, if you do not understand, i could send a image)
I want to fix x in 25 pixels for example. Don´t matter if I have 5 or 15 element, I want that x have the same 25 pixels.
But that I need, is set the same distance between each ticks in pixels.
I want to create a graph dinamically next to a tabular data, and I need that each row of the tabular data are in the same line at the graphic ticks.
.......................Tabular Data.............................................................Graph
Name............Value a........Value b
element 1.......2...............5................................1---| #########
.......................................................................X |
element 2.......4...............2.................................2--| ###########
.........................................................................|
element 3.......1...............2.................................3--| ###########
.........................................................................|
element 4.......3...............4................................4---| #######
...................................................................... --|
...................................................................... ---|
eleemnt n..........................................................n---| ##########
.......................................................................... __________________________________________________________
...................................................................................|.........|...........|..........|..........|...........|............|
(the dots are blanks, if you do not understand, i could send a image)
I want to fix x in 25 pixels for example. Don´t matter if I have 5 or 15 element, I want that x have the same 25 pixels.
Re: fix increment
This is the image
The idea is that each pair of gantt graph bars staying in the same line of their corresponding row of the tabular data for any number of elements.
In this example I have 12 elements, and x have one value.
I need that x has the same value If there are 5 or 15 elements,
The idea is that each pair of gantt graph bars staying in the same line of their corresponding row of the tabular data for any number of elements.
In this example I have 12 elements, and x have one value.
I need that x has the same value If there are 5 or 15 elements,
- Attachments
-
- graph.JPG (52.65 KiB) Viewed 13264 times
Re: fix increment
Hi tenaris,
Thanks for the picture and the explanation but I'm afraid I'm still not sure to understand what are you exactly trying to achieve.
If you want the right axis to always have the same minimum and maximum regardless of the number of gantts you have, you can call SetMinMax function.
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks for the picture and the explanation but I'm afraid I'm still not sure to understand what are you exactly trying to achieve.
If you want the right axis to always have the same minimum and maximum regardless of the number of gantts you have, you can call SetMinMax function.
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: fix increment
Thanks for reply
I think I understood your suggestion, I'm going check it later.
I got two new questions:
1. It's possible eliminate the labels in the left axe without eliminate the thicks and grid?
2. It's possible reduce de height of the bars in graphics gantt?
If it is possible, how can I do that?
Thanks in advance.
I think I understood your suggestion, I'm going check it later.
I got two new questions:
1. It's possible eliminate the labels in the left axe without eliminate the thicks and grid?
2. It's possible reduce de height of the bars in graphics gantt?
If it is possible, how can I do that?
Thanks in advance.
Re: fix increment
Hello tenaris,
First: using Custom labels:
Second: Using GetAxisDrawLabel
In two ways are necessary use empty strings, because if you only clear items ticks and grid don't appear
I hope will helps.
Thanks,
Yes it is possible. You have two ways:1. It's possible eliminate the labels in the left axe without eliminate the thicks and grid?
First: using Custom labels:
Code: Select all
private Steema.TeeChart.Styles.Line lineser;
private void InitializeChart()
{
lineser = new Steema.TeeChart.Styles.Line(tChart1.Chart);
lineser.FillSampleValues();
//clear text list for clipboard copy
tChart1.Legend.Visible=false;
tChart1.Axes.Left.Labels.Items.Clear();
for (int i = 0; i < lineser.Count; i++)
{
tChart1.Axes.Left.Labels.Items.Add(lineser[i].Y, " "); //could set spaces to length of orig text
}
}
Code: Select all
private Steema.TeeChart.Styles.Line lineser;
private void InitializeChart()
{
lineser = new Steema.TeeChart.Styles.Line(tChart1.Chart);
lineser.FillSampleValues();
tChart1.Axes.Left.GetAxisDrawLabel += new Steema.TeeChart.GetAxisDrawLabelEventHandler(Left_GetAxisDrawLabel);
}
void Left_GetAxisDrawLabel(object sender, Steema.TeeChart.GetAxisDrawLabelEventArgs e)
{
tChart1.Axes.Left.Labels.Items.Clear();
e.Text = " ";
}
Yes. You could use series.pointer.VertSize property as next lines:2. It's possible reduce de height of the bars in graphics gantt?
Code: Select all
gantt.Pointer.VertSize = 5;
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: fix increment
Thanks for reply
I had success in reduce the height of the bars in graphics gantt, but I couldn´t eliminate the labels in the left axe without eliminate the thicks and grid. I wrote the first code and grids and thicks were eliminated
I'm doing wrong?
Thanks in advance.
I had success in reduce the height of the bars in graphics gantt, but I couldn´t eliminate the labels in the left axe without eliminate the thicks and grid. I wrote the first code and grids and thicks were eliminated
I'm doing wrong?
Thanks in advance.
- Attachments
-
- Gráfico1.jpg (41.43 KiB) Viewed 13188 times
Re: fix increment
I forgot to mention that I am using WPF version TeeChart
Re: fix increment
Hello tenaris,
I couldn't reproduce your problem using previous code with last version of TeeChart.WPF and I have get next image, where grid and ticks of left axis, still appears. Could you please, say us what version of TeeChartWPF you are using currently?
Thanks,
I couldn't reproduce your problem using previous code with last version of TeeChart.WPF and I have get next image, where grid and ticks of left axis, still appears. Could you please, say us what version of TeeChartWPF you are using currently?
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: fix increment
Thanks
It worked out. I was doing wrong.
But settig labels with blank spaces doesn't solve my problem.
I need my panel not to have margin on the left side. And it's only possible if I remove the labels at the left axis (that includes the grid, and I don´t want to remove it). is It correct?
One alternative could be:
To draw lines that simulate the grid.
could it be possible?
I thought this because I need a tool tip in my gantt bar when the mouse is over it, and I do it this way:
When I do that, the labels in the left axis are very big, and the space between the axis and the begining of the panel is very big too. That's why I need to remove the labels,
and that is why I thought to draw lines like rows. (see figure 1 -the red lines-)
My questions are
1.-Is it possible to eliminate the space between the beginning of the panel and the left axis?
2.-Is it possible to draw lines like rows in figure 1 and lines like fixed values (see figure 2)?
3.-Is the way i´m using the tool tip correct?
It worked out. I was doing wrong.
But settig labels with blank spaces doesn't solve my problem.
I need my panel not to have margin on the left side. And it's only possible if I remove the labels at the left axis (that includes the grid, and I don´t want to remove it). is It correct?
One alternative could be:
To draw lines that simulate the grid.
could it be possible?
I thought this because I need a tool tip in my gantt bar when the mouse is over it, and I do it this way:
Code: Select all
gantt1.Add(dIni, dFin, 5.45, "Statistical\nElement:\t\tPressure Time\nBegin Date:\t1 jun 2010", Color.FromRgb(204, 0, 102));
and that is why I thought to draw lines like rows. (see figure 1 -the red lines-)
My questions are
1.-Is it possible to eliminate the space between the beginning of the panel and the left axis?
2.-Is it possible to draw lines like rows in figure 1 and lines like fixed values (see figure 2)?
3.-Is the way i´m using the tool tip correct?
- Attachments
-
- Gráfico1w.jpg (113.56 KiB) Viewed 13138 times
Re: fix increment
Hi tenaris,
Another option could be drawing manually lines where you want.
I've tested the three with this example. Uncomment the option you would like to try. The three look fine for me here.
You can remove the MarginLeft as follows.tenaris wrote:1.-Is it possible to eliminate the space between the beginning of the panel and the left axis?
Code: Select all
tChart1.Panel.MarginLeft = 0;
If you want to remove also the labels, maintaining the grids, you should implement one of the solutions Sandra proposed above.tenaris wrote:2.-Is it possible to draw lines like rows in figure 1 and lines like fixed values (see figure 2)?
Another option could be drawing manually lines where you want.
I've tested the three with this example. Uncomment the option you would like to try. The three look fine for me here.
Code: Select all
public MainWindow()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
new Steema.TeeChart.WPF.Styles.Gantt(tChart1.Chart);
tChart1[0].FillSampleValues(5);
tChart1.Panel.MarginUnits = Steema.TeeChart.WPF.PanelMarginUnits.Pixels;
tChart1.Panel.MarginLeft = 0;
//Option1: Custom Labels
tChart1.Axes.Left.Labels.Items.Clear();
for (int i = 0; i < tChart1[0].Count; i++)
{
tChart1.Axes.Left.Labels.Items.Add(tChart1[0].YValues[i], "");
}
tChart1.Axes.Left.Ticks.Visible = false;
tChart1.Axes.Left.MinorTicks.Visible = false;
//Option2: OnGetAxisLabel event
//tChart1.Axes.Left.Ticks.Visible = false;
//tChart1.Axes.Left.MinorTicks.Visible = false;
//tChart1.GetAxisLabel += new Steema.TeeChart.WPF.GetAxisLabelEventHandler(tChart1_GetAxisLabel);
//Option3: Manual drawing
//tChart1.Axes.Left.Labels.Visible = false;
//tChart1.BeforeDrawSeries += new Steema.TeeChart.WPF.PaintChartEventHandler(tChart1_BeforeDrawSeries);
}
//Option2: OnGetAxisLabel event
void tChart1_GetAxisLabel(object sender, Steema.TeeChart.WPF.GetAxisLabelEventArgs e)
{
if (sender == tChart1.Axes.Left)
e.LabelText = " ";
}
//Option3: Manual drawing
void tChart1_BeforeDrawSeries(object sender, Steema.TeeChart.WPF.Drawing.Graphics3D g)
{
for (int i = 0; i < tChart1[0].Count; i++)
{
double YVal = tChart1[0].YValues[i];
Point P0 = new Point(tChart1.Axes.Bottom.IStartPos, tChart1.Axes.Left.CalcPosValue(YVal));
Point P1 = new Point(tChart1.Axes.Bottom.IEndPos, tChart1.Axes.Left.CalcPosValue(YVal));
g.Pen.Color = tChart1.Axes.Left.Grid.Color;
g.Pen.Style = DashStyles.Dash;
g.Line(P0, P1);
}
}
Addign the following to the example above, everything seems to work as expected:tenaris wrote:3.-Is the way i´m using the tool tip correct?
Code: Select all
DateTime dIni, dFin;
dIni = DateTime.Today;
dFin = DateTime.Today.AddDays(4);
gantt1.Add(dIni, dFin, 5.45, "Statistical\nElement:\t\tPressure Time\nBegin Date:\t1 jun 2010", Color.FromRgb(204, 0, 102));
Steema.TeeChart.WPF.Tools.MarksTip tool1 = new Steema.TeeChart.WPF.Tools.MarksTip(tChart1.Chart);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |