How can i disable some of the legend at livechart? - wpf

I am using live-chart to plot some series. I also want to add a border to chart area so I added it as a new series. but when I want to show the legend of the main series the legend of border will be appear at chart. Is there any solution to disable this specific legend?

You can change the visibility of a series by changing the Visibility Attribute
e.g:
series.Visibility = Visibility.Hidden;
Not sure If that already solves your problem, since I'm not sure if I understood you correctly. You can also change the z index of a series by using the SetZIndex Method
e.g:
System.Windows.Controls.Panel.SetZIndex(series, 0);

Related

yAxis labels are being cut off in ngEchars (Echarts)

I have user ngEcharts (angularjs plugin of Echarts). When i implement bar chart yaxis labels are cutting off.
can anyone point me on the direction to how to prevent this or increase yAxis label area or decrease chart area?
After Ovilia's link i was able to remove cut off using it's grid property.
It has containLabel property.
Once i set containLabel it to true, i didn't need to set grid size. it worked!

How to set telerik chart TrackBall position programatically

I have created a custom control which has Telerik RadCartesianChart. This custom control creates any number of charts based on user dropdown selection. The number of charts on screen can vary but all have same x axis. I added a chart track ball line on custom control which is working fine on one chart on mouse movement. I want to add the same track ball line on all of the other chart on window so that movement on one track ball would reflect the same position on the other charts.
How could I implement this behavior programmatically?
I don't know if you can do what you are attempting without adding a ChartTrackBallController to every chart.
What I'd suggest is adding multiple series to the one chart, share the X axis but have multiple Y axes as required. This way the ChartTrackBallController will pick a point on all series in the chart.
// Trackball
ChartTrackballController ctbcMain = new ChartTrackballController();
ctbcMain.TextNeeded += ctbcMain_TextNeeded;
ctbcMain.InnerPointSize = new SizeF(0, 0);
ctbcMain.OuterPointsSize = new SizeF(0, 0);
rcvUPM.Controllers.Add(ctbcMain);
rcvUPM.ShowTrackBall = true;
In the above code snippit, rcvUPM is a radchartview containing all the data series you want to show, and ctbcMain_TextNeeded is used to customise the content of what the hover for the trackball shows.
It seems that by default the hover content will contain multiple points from each series, even after the InnerPointSize and OuterPointsSize was set to zero on advice by Telerik support a LINQ FirstOrDefault was needed on the collection of DataPointInfo objects to limit it to one point per series.

How to render jqvmap without border?

I am using jqvmap to render clickable world map. I set borderWidth=0 but still it is giving border to each country. I want all maps with no border. Seems like I will need to set some other property along with borderWidth.
If no possible then how I can set map fill color to border for selected countries so it will look like no border.
Please help.
By simply setting the BorderColor parameter to the same color as the map I was able to make them "disappear". Looking at the jquery.vmap.js I see that there is a condition such that the parameter passed along with the map for setting the border width will only be used if it's greater than 0, so you can either a) set the border to the same color as the map or b) modify the jquery.vmap.js to set the border to 0 as a default. I've tried both and got the desired result.

How to change shape of elements in the legend - jFreeChart?

How I can change the shape of elements of legend for jFreeChart without changing the graphs of diagrams ?
I have ready time series diagram. I need to update the existed data markers in legend to the simple line with defined colors.
Start by not adding a LegendTitle to your chart. This is usually a controlled by a parameter to your ChartFactory or your JFreeChart constructor. Both CategoryPlot and XYPlot have a setFixedLegendItems() method, mentioned here, that you can use to add a collection of arbitrary legend items.

Telerik bar chart x-axis with long texts

I'm trying the telerik bar chart in my mvc application. The texts on the x-axis labels can sometimes be very long and then they overlap.
How can i solve this? can i use a tooltip for this? and how to set the tooltip text for each bar?
Thanks in advance.
You can add a tooltip by adding Tooltip(true) like so:
Html.Telerik().Chart()
.Name("chart")
.Theme("vista")
.Series( series => series
.Bar( /*data*/)
.CategoryAxis( axis => axis
.Categories( /*data*/)
.Tooltip(true)
This will display the value of the Series (x-axis) on hover.
I know you can rotate the labels on the category axis by doing something like this:
.CategoryAxis( axis =>
{
axis.Categories( /*data*/ );
axis.Labels(labels => labels.Rotation(45));//this rotates 45 degrees (you can use whatever value you want)
}
but I don't think the Label method is available on the Series. You may consider flipping the Series and the Axis (if that would still make sense for your data). You may also consider formatting (abbreviating) the x-axis labels and adding your own legend.

Resources