Android Custom Bar Issues

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Jbarrot
Newbie
Newbie
Posts: 1
Joined: Thu Apr 04, 2013 12:00 am

Android Custom Bar Issues

Post by Jbarrot » 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 );

Yeray
Site Admin
Site Admin
Posts: 8746
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Android Custom Bar Issues

Post by Yeray » Thu May 09, 2013 3:38 pm

Hello,

CustomBar is the parent of Bar and HorizBar because these two series share most part of the characteristics, but it's not designed to be directly added to a chart.
Jbarrot wrote:I would use the standard bar but it seems like the Custom Bar has some options I will need for my chart
What are those options?
I can change CustomBar for Bar in your code and it seems to work fine for me here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply