Teechart Legend Style - activex

In My Code there is requirement when user click on a Bar of a series the CheckBox Style of the Series should be changed to none.But when i do that my Chart Width is increasing. IS there any way we can keep the chart width fix irrespective of legend table width.
Thanks
Akshay

This Can be done
GetLegend().SetResizeChart(false);
GetLegend().SetCustomPosition(true);
GetLegend().SetPositionUnits(muPercent);
GetLegend().SetLeftPercent(83);
GetLegend().SetTopPercent(10);

Set your legend Alignment in bottom for Avoiding width increment of chart as below.
Chart.GetLegend().SetAlignment(laBottom);
if you want custom position of legend (Right side of chart)then you can do as below.
m_Chart1.GetLegend().SetCustomPosition(TRUE);
m_Chart1.GetLegend().SetPositionUnits(muPercent);
m_Chart1.GetLegend().SetTopPercent(20);
long leftmargin = 80.0;
m_Chart1.GetLegend().SetLeftPercent(leftmargin );
m_Chart1.GetPanel().SetMarginRight(100-leftmargin+1);//for avoiding overlapping of legend and chart
Also you can finetune your legend and chart by modifying above value

Related

Fixed plot height in scatter chart

I have been searching this but not able to get any solutions for this. I want my scatter chart to be of fixed height regardless of no of legends used.
Please look into below fiddle link:
http://jsfiddle.net/3o982ewu/118/
"chart": {
"type": "scatter",
"zoomType": "xy",
"plotBorderWidth": 2,
"width": 400,
"height":400,
.....
I have set chart height to be 400. If no of legends increase, then scatter chart height gets adjusted (decrease) accordingly. You can try increasing the legends and notice that chart height gets decreased. I have tried other options like setting margin top and bottom (suggested in one post) but no luck.
I see that in highcharts js, there is 'plotHeight' variable which is used to set the chart height but I find no means to set it from my code or provide into as chart options. This scatter chart will be displayed in pdf so there is no scope of adding pagination, scrolls or any other stuff which is feasible only in web browser but not in pdf.
I am answering my own question because I found a way to deal with this scenario.
We hid the legends on the chart, so this way plot height of the chart will be always fixed. (plotHeight will be equal to the height of the chart which we provide in the chart settings considering we don't supply any margins)
We stored the data points (color of the legend and legend name) in the array and printed those outside the chart to make them appear as legends.

How to align multiple charts with different data

I have three pie charts displayed in a row. Two have two segments, one has five. All three have vertical legends.
Given that, the chart with five segments displays the pie slightly smaller, due to the extra height of the legend. It also has a slight negative vertical offset.
Is there any way I can set all three charts to render the chart in the same position? I've tried setting the center to 50%,50% in plotOptions, didn't help.
You have to set the marginBottom-Value of the chart to a value that is equal an all charts. Highcharts is trying to display the pie as big as possible, therefore it will use more space if the legend is not as big.
By setting the marginBottom you force the chart to ignore the actual legend size.
The center: ['50%','50%'] setting will only take into account the actual plot area. So if this area is decreased because of a taller legend it has no effect.
I made a jsfiddle where you can explore this settings:
http://jsfiddle.net/doc_snyder/dsmgy6ts/

HighCharts: How to change style of bottom most x-axis grid line

I am using Highcharts for one of my project. Everything is okay except I could not change line style('Solid','ShortDash','ShortDot','ShortDashDot','ShortDashDotDot','Dot','Dash','LongDash','DashDot','LongDashDot','LongDashDotDot') of bottom grid line in x axis as shown in the attached image.
Because the line you highlighted is not a gridLine of yAxis and dash style does not apply to it. In fact it covers the bottom-most grid line. Disable it by setting its width to 0.
API Reference:
http://api.highcharts.com/highcharts/xAxis.lineWidth
http://api.highcharts.com/highcharts/yAxis.gridLineDashStyle
Example:
http://jsfiddle.net/mnp6xa57/

How to set different bar width in the same series Highchart

In my bar chart the point range is not equally, so I want to draw different widths for bar chart using highchart. However, all the solution is to draw different series. I wonder is there any solution to hack the code and only change the pointwidth inside one series?
Here is a screenshot
The easiest way would be to change width property of a column SVG element.
Example:
http://jsfiddle.net/6o7290uf/

Constant height of chart regardless number of series displayed in legend

How to configure the chart options to get a constant height chart
regardless the number of series displayed in the legend ?
Below 2 links to exported charts showing the problem.
Notice that the height of the chart has descreased.
Ideally, the legend would be displayed at the bottom of the
chart when user process to an export of the chart.
Let me know if I have missed something from the documentation.
Best regards
Patrick

Resources