[SOLVED] Negative Bars in TBarChart? lazarus / 55-TAChart ---------------------------------------------------------------------- jwdietrich · 2012-05-12 10:13 What are the required steps to allow drawing of negative bars in TBarChart? If I write (using the barchart example that comes with Lazarus) Code: [Select]  BarChart1.AddBar('1999',200,clGreen);   BarChart1.AddBar('2000',-300,clred);   BarChart1.AddBar('2001',300,clred);   BarChart1.AddBar('2003',400,clGreen);   BarChart1.AddBar('2004',400,clGreen); the negative bar at 2000 is clipped at the left margin of the plot. What do I have to do that the plot scales to draw all bars? ---------------------------------------------------------------------- Ask · 2012-05-12 11:29 TBarChart is deprecated. You can try using TAChart instead. ---------------------------------------------------------------------- jwdietrich · 2012-05-12 11:43 Thanks for the hint, I didn't know that. I will give TAChart a try. If TBarChart is deprecated it might be an idea to remove the demo that is bundled with Lazarus. ---------------------------------------------------------------------- BigChimp · 2012-05-12 12:20 ... 5th link from the top in the list with links top leftt... ---------------------------------------------------------------------- jwdietrich · 2012-05-12 12:27 Thanks again for the hints. The solution is quite easy. The steps are: 1. Create a TChart in the form 2. Create a TBarSeries in the Chart 3. Add Code: [Select]BarSeries.AxisIndexX := 1; BarSeries.AxisIndexY := 0; 4. Use the rotate procedure from the rotate demo of the TAChart component. ---------------------------------------------------------------------- jwdietrich · 2012-05-12 12:31 Quote from: BigChimp on May 12, 2012, 02:20:59 pm... 5th link from the top in the list with links top leftt... OK, I will even go an additional step and modify the demo application, so that it is based on TAChart. But I will not manage to do this today. ---------------------------------------------------------------------- BigChimp · 2012-05-12 12:39 Thanks a lot! ---------------------------------------------------------------------- Ask · 2012-05-12 17:09 Quote from: jwdietrich on May 12, 2012, 02:27:59 pm4. Use the rotate procedure from the rotate demo of the TAChart component. Note that this step is required only if you want to allow user to rotate the chart. If you just want the horizontal bars, setting AxisIndexX = 0, AxisIndexY = 1 is enough.