PoplarTang / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

Gradient in timechart #387

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a TimeChart using XYMultipleSeriesRenderer
2.Enable gradient for one or more XYSeriesRenderer
3.

What is the expected output? What do you see instead?
Hoped to have a gradient

Please provide a source code snippet that we can use to replicate the
issue.

  protected void setRenderer(XYMultipleSeriesRenderer renderer, int[] colors, 
    PointStyle[] styles, boolean[] fillBelowLine, int[] fillColors) {
    renderer.setAxisTitleTextSize(16);
    renderer.setChartTitleTextSize(16);
    renderer.setLabelsTextSize(16);
    renderer.setLegendTextSize(16);
    renderer.setPointSize(5f);
    renderer.setYLabelsAlign(Align.RIGHT);
    renderer.setMargins(new int[] {20, 40, 10, 20 }); 

    int length = colors.length;
    for (int i = 0; i < length; i++) {
      XYSeriesRenderer r = new XYSeriesRenderer();

      r.setColor(colors[i]);

      if (fillBelowLine[i]){
          FillOutsideLine fo= new FillOutsideLine(XYSeriesRenderer.FillOutsideLine.Type.BELOW);
          fo.setColor(fillColors[i]); AndroidUtils.changeLColor(colors[i], 0.8)) ;
          r.addFillOutsideLine(fo);
      }

       r.setGradientEnabled(true);
       r.setGradientStart(900, Color.GREEN);
       r.setGradientStop(1200, Color.BLUE);

      r.setPointStyle(styles[i]);
      r.setDisplayChartValues(true);
      r.setChartValuesTextSize(16);
      r.setChartValuesSpacing(3);
      renderer.addSeriesRenderer(r);
    }
  }
What version of the product binary library are you using?
Version 1.1.2

Please provide any additional information below.

Original issue reported on code.google.com by stef.ba...@gmail.com on 23 Jan 2014 at 9:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Got a basic gradient effect subclassing linechart
It doens't take in account gradient start/stop values but for me is enough
it would be great anyway if you could include garadient in linechart in next 
version
Thanks
Stefano

Original comment by stef.ba...@gmail.com on 26 Jan 2014 at 9:36

Attachments: