I can add a custom SVG element to a chart like the wind arrows in the meteogram example. Note how the look of each individual wind arrow is customized with the parameters (a) wind speed and (b) direction.
I can also place custom SVG markers on to a series like the cross in the custom markers demo.
The latter approach has the advantage that if I have a zoom-able chart (Highstock) the markers will stay where they are supposed to be when zooming/panning. However, the latter example does not allow parameter dependent customization of the SVG marker!
Is there a way to combine these two? As in, I want custom SVG markers, that are bound to the series but whose shape is determined by other external parameters.
Related
In Vaadin 14.4.2, is it possible to create a Chart with multiple series in a way in which the color of the series is programmatically calculated? Specifically, I may have ~100 series, but they all are associated with a "number" (specifically a mass of a chemical element). Since I know what in my application the "number" (ie the mass) will range from 100 to 2000, I would like the color of the series to range from blue (at 100) to red (at 2000). This way, when a user looks at the graph, they intuitively know whether the series refers to a heavy chemical (red) or a light one (blue).
In order to accomplish this, I think I would need to have some way of programmatically setting the color of a series, but I do not think that's actually possible in Vaading 14.4.2, right?
Here's an example of such a chart:
Color of the data series are defined by the custom properties --vaadin-charts-color-0, --vaadin-charts-color-1, ... , --vaadin-charts-color-9. You can programmatically define their values like follows
charts.getElement().getStyle().set("vaadin-charts-color-1","#2dd7a4");
The second string parameter is the color value, it can be any format accepted in CSS.
I have designed a treemap using highcharts with custom algorithm.It has a drilldown to 1 level. There is a drop down for my chart and it has two options for selection. treemap is displayed on the basis of dropdown selection which has a group by feature implemented using underscore.js library. The feature is working fine. But the problem is, all the tiles which are grouped together, are placed next to each other. My requirement is : i want all those tiles to be packed in one big tile with one label. something like header title in D3(exactly the same). Please let me know how to go about it. Is it something like treemap within a treemap? Also i wanted to know if its feasible to have different labels and tooltips for parent and children in the same treemap. any leads would be helpful.
actual image
I'm drawing a chart in an iOS app and I want the gridlines to start in the x axis but end in the data point instead of extending all the way up to the top.
Is this possible?
Thanks in advance.
NC
Disclaimer: I work for ShinobiControls
The shinobicharts framework doesn't currently support this as an out-of-the-box feature.
A workaround may exist though. You may be able to add your own gridline subviews by using the SChartAxis method pixelValueForDataValue: to work out where in the plot area coordinate space you should draw your vertical line up to for a given data point.
Once you have your coordinates there are various ways you could draw your gridlines:
Add a canvas view behind or in front of the chart (depending on what effect you want). Then use your coordinates to draw your gridlines using CoreGraphics or some other drawing technique.
Create individual UIViews that each represent a gridline using your coordinates and add these behind or in front of the chart.
One thing to be aware of with this technique is that the gridlines will not automatically update when you pan and zoom. In order to do this you will need to override one of the chart's delegate methods that notify you of range changes and update your drawn gridlines to match the new data point positions.
Another potential workaround could be to use a column series to mimic gridlines. If you create a column series and feed it the same data points as your original series this will result in columns that go up to the y-value of each data point. You could then use the property interSeriesSetPadding on SChartAxisStyle to cause the columns to appear very thin.
I hope that information is useful!
We are currently using HighCharts for our typical bar, pie, line charts. But, we have been asked to plot some medical data that would end up resembling an irregular loop.
If I have an array of x,y points, would it be possible for me to draw this sort of graph with HighCharts? And, if so, can you point me to the right section of the documentation. I see that drawing things like rectangles and circles is possible, but I haven't found any info on drawing lines between arbitrary points.
I can see only three ways to achieve that, and none of them is easy, and have some limitations:
1) Use spline series with unsorted data - looks almost good, only tooltip doesn't work for unsorted data
2) Use scatter series with unsorted data - issue with tooltip is gone, but curves aren't smooth
3) Use renderer.path - doesn't have tooltip at all, and requires to add path manually.
And example of all three: http://jsfiddle.net/kEu3w/
I've noticed that the OpenVG transformation matrix is ignored by the text rendering routine at all and I cannot control the text position with it manually with VG_GLYPH_ORIGIN parameter.
I'm implementing a scene graph. I found out that I can use vgGetMatrix, read components 6 and 7 of the current 3x3 transform matrix and set VG_GLYPH_ORIGIN to those values before drawing a block of text. This allows the text origin to be placed in correct place, but the text is still always displayed left-to-right.
However, this itself doesn't enable me to do any other transformations, like rotation. I'm surprised because the text is composed from VGPaths and they are indeed transformed
Is there a way to make the text rotated with OpenVG 1.1? Or should I ignore the text functionality from OpenVG 1.1 and draw the letters as individual paths or images manually?
All the draw functions use a different user->surface matrix:
vgDrawPath uses VG_MATRIX_PATH_USER_TO_SURFACE
vgDrawImage uses VG_MATRIX_IMAGE_USER_TO_SURFACE
vgDrawGlyph/vgDrawGlyphs use VG_MATRIX_GLYPH_USER_TO_SURFACE
By default, all of the matrix functions (vgTranslate, vgRotate, vgLoadMatrix, etc) operate on VG_MATRIX_PATH_USER_TO_SURFACE. To change the active matrix, call vgSeti with VG_MATRIX_MODE as the first argument:
vgSeti(VG_MATRIX_MODE, VG_MATRIX_GLYPH_USER_TO_SURFACE);
/* now vgTranslate, vgRotate, etc will operate on VG_MATRIX_GLYPH_USER_TO_SURFACE */