I’m trying to make a chart with bars that go from left to right using GWT. I looked at the Chart Tools API Library for GWT, but the ColumnChart class only makes bars that go up and down. Does anyone know how to make the bars go sideways instead? I’ve been searching for a while but can’t find a good way to do this. Maybe there’s a trick to rotate the chart or a different class I should use? Any help would be great. I’m not super experienced with GWT, so simple explanations would be really helpful. Thanks!
hey amelial, have u tried the BarChart class instead? it should give u horizontal bars. if that doesn’t work, maybe u could use a regular ColumnChart and mess with the CSS to rotate it 90 degrees. just an idea, not sure if it’ll work perfectly. good luck!
I’ve actually implemented something similar in one of my projects. The BarChart class is definitely the way to go for horizontal bars. One thing to keep in mind is that you might need to adjust the chart options to get the look you want. For example, I had to play around with the chartArea width and height to make sure the bars weren’t too squished or stretched.
Also, don’t forget about the legend placement. By default, it might not look great with horizontal bars. I found setting the legend position to ‘none’ or ‘top’ worked best for my layout.
If you’re dealing with a lot of data, consider using the hAxis.viewWindow option to focus on a specific range. It really helped improve the readability of my chart.
Lastly, if you’re feeling adventurous, you can customize the colors of your bars using the colors option. It’s a small touch, but it made my chart feel more integrated with the rest of my app’s design.
I’ve faced a similar challenge with GWT charts before. The BarChart class is indeed what you’re looking for. It’s specifically designed for horizontal bars. To use it, you’ll need to import com.google.gwt.visualization.client.visualizations.BarChart and set it up similarly to how you would a ColumnChart. The main difference is in the data orientation. Make sure your data is structured correctly - the first column should be your labels, and subsequent columns will be your data series. If you’re still having trouble, check the GWT Visualization API documentation. They have some good examples that might help you get started.