Remove Space Between Bars in Bar Chart in Google Visualization API - charts

I have a single data series and need the bars stacked right next to each other. What Google Visualization API call / property would help me accomplish this?

Set the bar.groupWidth option. You can either set it as an integer (number of pixels for the group to take up) or as a percent of the available space. In your case, I suggest using the percent:
bar: {
groupWidth: '100%'
}
That will remove all space from between adjacent bars.

Related

Tableau - How to make bar chart with bars of different widths

Tableau Public, SQL, Excel. I have an up and down bar chart of about 30 customerIDs and how much they spent. ~3 big spenders, ~5 medium spenders, many small spenders. I want to make one bar chart with the three big spenders having fat bars, the 5 next spenders having medium thickness bars, the rest having very skinny bars. All on the same chart from the same excel sheet of data. Any way to do this? Tableau Public/SQL/Excel. Extra credit: any ways to make the bars different colors or maybe shaded in some way? Thank you so much in advance anon tech guru!!!! You're the best!!!
Example of what I mean: https://drive.google.com/file/d/1jbAwfhx7hmgwNYWNaU5EOI8MLglEt6sE/view?usp=sharing
not sure what to do!
Place your total $ on Size marks.
Or if you want to have them to be the same for each group, make a calculated field based on the cutoff desired and place that on size.

How to achieve this kind of heatmap / bar chart with Chart.js

I have to build a horizontal bar with chartjs. I already built a few of them but its a bit different. The chart has 2 labels for the yAxis ("Storm Risk", "Ice Risk") and hours for the xAxes. I have to print out for every hour one of these different options with different colors ("Low", "Medium", "Hight") as ye can see in the screenshot attached.
This kind of bar chart usually the values are represented by the length of the bar and its a bit different.
Any suggestion?.
Thanks
The chart you want to implement is a sort of a "heatmap". As of now (Sep. 2018), Heatmap charts are not supported out of the box by Chart.js. However, you can make one out of a stacked bar chart (in this case, probably stacked horizontal bar chart?): make each stack size equal to one another and each item backgroundColor depending on the actual values being represented. Once this is done, you can override ticks and tooltips using with according callbacks. Legend can be implemented by one more bar chart with sample values and colors.
More details can be found in a related GitHub issue: https://github.com/chartjs/Chart.js/issues/4627
Another alternative would be to use a BubbleChart. The strategy would be similar - you would need to make all bubbles same size, but override their colors. However, provided the look in the question, stacked horizontal bar chart will be more suitable.
Another option for those who are still looking is to use chartjs-chart-matrix https://chartjs-chart-matrix.pages.dev/usage.html plugin.
Example of implementation with Chart.js v3: https://www.youtube.com/watch?v=bi04BgvNY6U

Display color legend on tableau chart

Is there a way to display color legend on the top left side of a chart .
I have 4 charts in a tableau dashboard and if i display all the legends for all the 4 charts on the bottom it looks busy so I want to include the legends in the charts.
Please help me on this with details steps.
What you want is to make the "legend" a floating object instead of the default tiled object.
To achieve this; You can hold down the Shift key, then drag the legend using the left mouse button while still holding down the Shift key. Drop the legend wherever you wish on the dashboard. Make sure you only release the Shift key after you have dropped the legend at your desired destination.
Warning: Depending on the size of the dashboard you selected, floating objects move around when end users view your dashboard on a device with different screen resolution. To avoid this you can use the "Exactly" size option and define a size range which suits your needs.
To include legends on top left Side of the chart.
Follow steps here as under:
Step1:
Select legends, Right Click on legends top part and select floating and place inside the chart on the top part below heading of Graph as :
So you can follow above steps to add legends in all 4 charts.
Output will look like as
So in this way your legends will not be clumsy and you can describe visualization in a better manner.

multiple stacked area charts nvd3 - errors

I am trying to create a dashboard with multiple area charts on the same page. I have two issues.
I want to get rid of the small circle on the chart that indicates value point and moves along with the cursor and the interactiveguideline. What is the name of that circle and how do I remove it?
After some research, I figured out how to change the Y-axis values to percentages. But I would like some graphs to show percentages and others to show regular numbers. Is there an easy way to do this?

How can I get the size of the Plot Area in a Microsoft Chart Control

I am using the MS Chart Control in a Windows application.
I am charting various series dynamically and the user can specify which charttype each series should be. This leads to situations where pie charts are combined with line/spline charts etc..
When at least one series is specified to be a pie chart, I am dynamically adding chartareas and legends to give each of these series their own chartarea, while all the "basic" charttypes (line(area)/spline(area)/etc.) are combined into a single chartarea.
The issue is that when adding 10+ series where the majority are pie charts, the charts are resized so small, they become useless. My thought was to dynamically increase the size of the chart control (thereby increasing the size of all chartareas within). My issue is, the width and height of the InnerPlotPosition are always zero unless I set them explicitly.
Is there any way to determine the size of the Plotting Area in pixels or percentage (which I could multiply by the chart controls size to get pixels), etc. even if not explicitly set? This would allow me to increase the chart controls size until some minimum ( and hopefully, readable) value was reached.
I find that InnerPlotPosition is set at least in a PostPaint event callback. You may be checking that property before the Plot Area has been calculated.
This works:
var c = new Chart();
c.PostPaint += c_PostPaint;
// Do whatever to setup the chart
// Then in my case I'm saving the image which causes rendering
c.SaveImage(myFileName);
void c_PostPaint(object sender, ChartPaintEventArgs e)
{
var ipp = e.Chart.ChartAreas[0].InnerPlotPosition; // Values populated here
}