achartenginge manual legends and labels - achartengine

I developed an app for Android using achartengine for some charts.
I have 68 XYseries in my chart, but I want to have only 2 Legends. All XYSeries in red = one legend. All XYSeries in green = second legend.
Also I need manual Labels for the Y Axis. Y=1 should be g for example.

There is a setShowLegendItem(boolean showLegend) method in SimpleSeriesRenderer, so it is inherited by XYSeriesRenderer. You should call this method for most of your renderers excepting 2 of them.
In order to have custom Y axis labels, you need to do the following for each such lavel:
renderer.addYTextLabel(y, "text");
And you also need to disable the default labels:
renderer.setYLabels(0);

Related

Highcharts Columnrange Questions (multiple y-axes and column widths)

I'm in the process of evaluating Highcharts as a replacement for our current platform, and have some questions about how we can replicate one of our existing charts:
I've been able to recreate the basic floating stacked column chart, but need help with some of our specific features.
1) Is is possible to replicate the multiple y-axes with the columns displayed to the right of each within a single chart? If not, I suppose we could do 3 charts next to one another - and draw our own titles above (and data table below). If we go this route, is there a way to group all these elements in a single "container"? We need to export these charts to images and need to end up with a single image that looks like the one attached.
2) How would I create the inner box within each column? Do I need to draw it myself, or can I create another column series with a border and transparent fill and somehow set the width of the column to be less than the width of the main columns (note that the number of columns on each chart is dynamic, so the column widths can't be a fixed size. i.e. the inner box width needs to be a percentage of the main column width)?
3) Assuming #2 is possible, I could probably use the same technique to plot the horizontal line - just make the height 0 (or very small) and make the bar wider instead of smaller. Is there a better way?
4) How do I get the x coordinates of the columns so we can align our data table under each column?
5) Can I separate the individual points within the column. You'll notice in my jsfiddle, product 1 and product 2 are vertically aligned in the center of the column. Can I spread them out within each column as the 2 points are in the screenshot?
Thanks in advance for advice on all or any of the above.
Mike
1) You can use multiple yAxis, see the example
2) You can use renderer or mix column/column range and border parameter, example
plotOptions: {
columnrange: {
pointPadding:0.2,
color: 'rgba(255,255,255,0)',
borderColor: '#303030'
}
},
3) Use renderer, as above or scatter series with customied marker
4) Column is shape in point.element.graphic, so you can extract it.
5) as far as I know, it is not possible

Changing lables on x-axis like from Monday to show M as per window size in HighCharts

I am using highcharts library to draw chart and I need to display Weekdays as labels on x-axis and also to auto reset it like from Monday to M if all weekdays can't fit on screen.
It should be dynamic, which means no flickering should appear when changing label text on x-axis.
Any suggestions?
Thanks in advance.
There is no straight option for that, rather simple workaround:
Disable reflow from Highcharts, use window.resize browser event
In that event add condition to decide showing full name of just shortened, and set this for chart - chart.xAxis[0].dateTimeLabelFormats should be fine
After setting new format, apply new chart dimensions using chart.setSize(w, h)

AChartEngine Time Chart with multiple Y scales and axis

How can I create a Time Chart with multiple Y scales and axis with AChartEngine? Thanks
You will have to build a CombinedXYChart of line charts and use custom labels instead of the default ones.
TimeChart is not supported in the CombinedXYChart.
Update: See this example and just create a time chart instead of a cubic line chart.

Axis Lables Rotation

Hi I am using HighStock 1.2.4
I do have multiple series and separate yAxis for each series. I am calculating height and topPadding and creating stacked series.
Now, I am facing two problems.
I have used rotation with yAxis to rotate labels but its not rendering correctly.
Example: http://jsfiddle.net/mhardik/uZaWz/9/
I have also used rotation for X Axis labels, but the last series position is getting messed with X Axis Labels.
http://jsfiddle.net/mhardik/uZaWz/10/
1) I'm not sure why it's not rendering correctly, if you want to move a little to the left use x: property for title.
2) First, I think you need to set proper align for xAxis.labels (right). Then make higher chart to make sure you have enough space for a chart.
And jsFiddle: http://jsfiddle.net/Fusher/uZaWz/12/

How to position labels for plotbands on y axis in Highcharts

This Link is a similar example from highcharts.com which i'm working on. I'm trying to place the labels for plot bands on y axis. But as you can see the labels are overlapping on the chart which isn't that good. If i wanna color the labels with the same color of the corresponding plotbands, the label doesn't show up. Is there a way to place it completely outside without overlapping?
Thanks in advance.
A possible solution is to add right margin to the chart, and move the labels over.
Add a marginRight to the chart, and on each label, use x to determine its starting x position.
marginRight:110
and
x: 90 on each label.
http://jsfiddle.net/7xb1Lgx6/ the fiddle.
I think it's not possible to do it yet.
If you add labels to the plotbands it will overlap them.
You can align your labels but if you set x more than your chart width, it will not appear on your chart.
demo

Resources