Android Custom Bar Issues
Posted: Wed May 08, 2013 3:24 pm
I am attempting to use the Custom Bar type on Android but am unable to actually get the bars to show. The marks show so I know the data is being presented correctly, but nothing I do seems to be able to make the bars themselves show. If I switch to a standard Bar the data shows fine. I would use the standard bar but it seems like the Custom Bar has some options I will need for my chart. Below is the code I am using to try to setup the chart:
Code: Select all
Chart chart = mTChart.getChart();
Axes axes = chart.getAxes();
axes.getBottom().setMaximum( 520 );
axes.getBottom().setAutomatic( false );
axes.getBottom().setLabelsOnAxis( true );
axes.getLeft().setMaximum( 130 );
axes.getLeft().setAutomatic( false );
series = Series.createNewSeries(chart, CustomBar.class, null);
CustomBar cb = (CustomBar)series;
cb.setBarStyle( BarStyle.RECTANGLE );
ChartPen pen = cb.getPen();
pen.setWidth( 1 );
pen.setStyle( DashStyle.SOLID );
//pen.setColor( )
series.getMarks().setVisible( true );
cb.setMultiBar( MultiBars.STACKED );
cb.setBarStyle( BarStyle.RECTANGLE );
cb.setColor( Color.RED );
cb.getBrush().setColor( Color.BLUE );
cb.getBrush().setTransparency( 0 );
cb.setVisible( true );