I am working with TeeChart fro .net, I would like to increase the size of drawing line in the chart. presently it is drawing very thin line which is not visible for all people. How to increase size of drawing line in TeeChart.
I have attached a simple chart image from my application. I would like to draw the line with more or equal size to axis lines. presently it seems drawing line size less that axis line size. I mean i want to draw line more thick.
2) How to assign axis scale more reliably, i mean presently if i have axis minimum and maximum values from 0 to 6, then it is showing on the axis like 0,2,4,6. I would like to see like 0,1,2,3,4,5,6 like that i mean with 1 scale increment. Please help me with the above two things.
1) How to increase drawing line size?
2) How to assign scale of axis more convenient?
The chart's features mention support for Csharp .NET charting control.
http://www.steema.com/teechart/net
Microsoft has pages with information about the chart controls:
http://msdn.microsoft.com/en-us/library/dd456632.aspx
Looks like you will find how to do the things you want there.
1) How to increase drawing line size?
You can set Line or FastLine Pen.Width like this:
line1.LinePen.Width = tChart1.Axes.Left.AxisPen.Width;
2) How to assign scale of axis more convenient?
TeeChart will automatically set axis scales to the minimum increment possible provided labels don't overlap. To get a fixed axis increment you should set axis Increment property. Labels won't be allowed to overlap though.
tChart1.Axes.Bottom.Increment = 1;
For more information on axis settings please read tutorial 4. Tutorials can be found at TeeChart's program group.
Related
I have a chart using Syncfusion LineSeries.
I would like to scale the data on the X axis. Only the same values in the graph (the data on the axis label should be the same as it is now)
In short, the visible graph should be horizontally downloaded (e.g. scaled down 10 times)
Can it be done?
Just dividing the value by 10 does not change anything when the chart continues to fill the chart completely.
Image
We would like to suggest the following chart axis features.
Maximum property used for setting the maximum value for the axis range
Minimum property is used for setting the minimum value for the axis range.
EnableAutoIntervalOnZooming property is used to maintain the interval even it is in zooming state only if we set the interval to the axis. Default value of this property is true. While zooming based on the auto range padding the interval will be calculated.
For more details, please refer below UG,
https://help.syncfusion.com/wpf/charts/axis
Note: I am working in Syncfusion.
Does anybody now how to prevent the Y-axis from moving (horizontally) when the text area increases (for example when displaying 100 instead of 1 on a label on the Y-axis).
The following image illustrates the problem; when a decimal is added to the number on the labels, the diagram is resized and the Y-axis is moved to the right:
The reason the Axis and other a few other ChartElements may move is that their Positions are set to Automatic by default; so when the lables need more space they get it and the inner portion is reduced.
So if you want to prevent that you need to set an explicit values for the X values of its Position.
Note that the values are in percent of the respective containers.
Unless you set a special Crossing value, the primary axes are always drawn to the left and bottom of the InnerPlotArea.
So you want to set the position, maybe like this:
ChartArea ca = chart1.ChartAreas[0];
ca.InnerPlotPosition.X = 10;
Note however, that this means: The Y-Axis will start at 10% of the whole ChartArea.Width, which usually means something like 'almost 10%' of the whole Chart.Width. (The Legend and some white space will usually take some space, too).
So if you resize your chart the axis may sit a little too much to the right.. You may want ot play with the number and maybe code an extra line in the Resize event of the Chart.
I have already defined listBox with all the functionality (It is a Graph with a dragging points). Around ListBox I want to add "GridLines" on X and Y axis (I hope thats the right word - data info on X axis and data info on Y axis - example - hour times every half hour or so on X and 0-100% on Y axis).
So on X axis I like to have hour from 0:00 to 24:00 and on Y axis % from 0 - 100. I can use normal label or textblock and write number in is the simplest idea. But because grid of listbox will change depending on the data, I like to have manageable scaling. Start is always eg. 0 and end is also always eg. 100%. I like to scale infos that show infos every 20 units (0%, 20%, 40%, 60%, 80% and 100%) or every 25% (0%, 25%, 50%, 75%, 100%) or so.
I think do it with a Borders (for little marking line) and in next row with TextBlock define value. All this wrap in DataTemplate.
If something unclear or have any questions please ask.
It sounds like the hard part of your problem is determining what grid line intervals to use. I describe a nice algorithm here that produces ranges which are pleasing to a viewer.
With this, you can then divide the dimension into spaces and scale the values accordingly. Whatever logic you use for the positioning of points should also be updated.
For drawing lines, you can add Line shapes to your Canvas.
My chart has a Datetime type X Axis and Double type Y Axis. I am trying to use the following code to insert the scalebreakstyle feature but it is not working. Does anyone have sample code for it. I was trying the web.UI code but did not work. Also I set the color of 2 series the same it keeps making them different.
/
/ Enable scale breaks.
chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Enabled = true;
// Show scale break if more than 25% of the chart is empty space.
chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 25;
// Set the line width of the scale break.
chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineWidth = 2;
// Set the color of the scale break.
chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineColor = Color.Red;
// If all data points are significantly far from zero, the chart will calculate the scale minimum value.
chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.StartFromZero = StartFromZero.Auto;
// Set the spacing gap between the lines of the scale break (as a percentage of the Y-axis).
chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Spacing = 2;
www.tinypic.com/r/6e2c83/5
Scale breaks will not work under a wide array of conditions. According to the documentation any of the following causes scale breaks to be "not supported", which I have found means they will not work at all or they will warp your graph in weird ways
•Pie, doughnut, funnel, pyramid, radial or any stacked chart types are used.
•Custom intervals for labels, tick marks or grid lines are enabled.
•The minimum or maximum value for the axis is set.
•Custom labels are used.
•A logarithmic Y-axis is specified.
•Axis views on the Y-axis, which include scrolling and zooming, are used.
•3-D charts are used.
It looks like you maybe have a custome x axis label which would cause the scale break to fail.
I am looking for options on how to draw 2 rulers at different scales on a canvas (assume a canvas) that will scale based on user-entered data.
Placing the tick marks and text one-time isn't a big deal, it is how to scale the data as the max/min values are changed by the user AND getting the points (ellipses) on the canvas to look correctly.
Foolishly, I set the size of the canvas to the max values of the current data, but as the data changes that won't work... I had hoped for a 1:1 translation...
Something like taking the current canvas size and redrawing the rulers is where I am headed
thanks,
rusty
I was over thinking the issue plus have just started in 'drawing', 'graphics', etc. Have a lot to learn. It was basic logical to physical translation math that most everyone 'knows'.
rusty