When using the Pie chart type in highcharts, something in my data is causing the slices of the pie to render as invisible until I click on each individual slice, at which point the slices will render normally. The lead lines do not have any issue.
If you are using the 'object' style data point format, the 'color' property cannot be null. If the 'color' property is null, the slices will not render properly. This does not appear to be an issue on any other chart type. This sort of thing can show up if you are serializing objects from c# that have an unset string type color property.
The solution would be to go through each data point and use the 'delete' keyword on the 'color' property.
Related
Is there any way to get the legend "icon" in tooltip? I need to show the legend "icon" in the tooltip so i can identify what series I'm referring to.
I'll try to explain it better.
When you create a chart, in the legend, next to the name of the series, there is a "mini" line, that represent the line of the series, the color, and the style.
That what I need to show in the tooltip.
I'm not referring to the dot marker but the small lines that appears in the legend.
Is that possible?
Edit:
I'm using the formatter that the tooltip api provides. There I have a reference of the point that I'm hovering on, and all the data associated to that point.
I can get the value, the chart, the series, the series to which it belongs, que point marker, almost everything.
But I can't figure how to get the little coloured line that appears next to every series name in the legend.
I guess is as simple as get one of the values that appears in the point data, but I don't know what I should look for, there are a lot of properties.
I found a solution.
You can look for the point.series.legendLine.
There you have all the info required for the legend svg, even you can get the outerHTML and paste directly to show the legend icon.
I've created a scatter highchart in Jaspersoft Server 6.2 (called ad hoc reports in the product) but encountered a strange problem where I cannot get normal color related properties to take effect. I normally just the property: colors ["#999999"] to other types of charts in Jaspersoft Server but for some reason this does not work in a scatter chart, I also tried using rgba values in the property.
I have searched extensively for a solution and everything that seems to apply to normal highcharts doesn't appear to work in Jaspersoft Server. I've tried adding the following properties:
series.color
series.data.color
series.marker.color
plotOptions.scatter.color
With hex and rgba values defined but the data points either remain black or disappear altogether. It's something that's very easy to manipulate in other chart types but scatter chart tye seems quite restrictive in Jaspersoft so perhaps not. Is there something simple I'm missing here?
JasperReports Studio's heat-map chart is based on Highcharts, so I can use the Highcharts API to customize charts through the advanced properties dialog. But I can't figure out how to apply a non-linear color gradient to a heat-map chart.
What I have tried:
I went to Edit Chart Properties > Advanced Properties and added the property colorAxis.stops, which requires an array of tuples. But no matter what format I try to supply the array, I just end up with a broken chart.
e.g. java.util.Arrays.asList("{0, #ff0000}", "{0.5, #ffff00}", "{0.9, #00cc00}") displays a heat-map with no data.
How can I supply the array to this property so that I can get a non-linear gradient? (Red to Yellow to Green)
I solved my own problem. Write this as an expression in the colorAxis.stops property:
java.util.Arrays.asList
(
java.util.Arrays.asList(0, "#FF0000"),
java.util.Arrays.asList(0.25, "#FF9900"),
java.util.Arrays.asList(0.5, "#FFFF00"),
java.util.Arrays.asList(1, "#00CC00")
)
Reference: http://community.jaspersoft.com/wiki/advanced-formatting-new-html5-charts
When using Highcharts, is it possible to change the contents of the legend to display something other than the series?
For example, I have a scatter chart with just one series but with many elements, so that the element labels obstruct one another and are illegible:
Would it be possible to use the legend to display the element names instead of the series? (each member in the series has a different color so that it is possible to use the legend in this case)
EDIT:
It turns out there isn't any good way to do this, so I wrote my own custom legend. You can find the code here: http://pastie.org/5115536
I hope you find it useful
Highcharts allows to show data points instead of series name in the in the legend. But, Unfortunately its only for Pie charts type:pie.
There is a default option available for the Pie Chart though undocumented in the API.
legendType: 'point',
If you try to set it for other type of chart, Legend does not gets rendered.
I had drawn a pie chart using core-plot. I need to display the item name when a particular slice is touched. can anyone suggest me a solution to achieve this?
You can handle individual slice events by implementing CPPieChartDelegate methods. Declare CPPieChartDelegate protocol and implement the method (void)pieChart:sliceWasSelectedAtRecordIndex: . Set the delegate of piechart to self(controller). This method gives you which slice(index) is selected. And now for drawing the label, you have to re-draw the pie chart, specifying which slice to be labeled. You can set empty string to labels for other slices.
The iPhone version of CPTTestApp (in the Core Plot examples folder) shows how to display the selected slice index. It displays the index in the graph title, but you just as easily display it in a Core Plot annotation or in a separate UI control.