how to change thickness of two doughnut charts in chartjs - reactjs

How can I change the thickness of two doughnut charts if one is nested inside the other.
Example: https://codesandbox.io/s/doughnut-chart-percentage-kqoi1?file=/src/App.tsx
I want to look it like this:
I've tried with the options 'cutout' and 'weight' and it works if I would have only one chart, but I can't change both to the same thickness.
I want to have both doughnuts as thin as in the picture.

You can define cutout: '90%' on both datasets.
cutout: The portion of the chart that is cut out of the middle. If string and ending with '%', percentage of the chart radius. number is considered to be pixels.
Please take a look on your amended Sandbox
Not sure why but I have to press the refresh button inside the Sandbox in order to have the chart drawn correctly. I guess, Sandbox is somehow remembering your original code after I forked it.

Related

Lightview chart histogram like Highcharts Stacked bar

Is there any way I can make a Lightview histogram chart with multiple values per data point, so that it looks like a Highchart stacked bar (https://www.highcharts.com/demo/bar-stacked)?
If not, is there a workaround?
I already overlay-ed two separate histograms, but that does not help, because both start at the bottom and depending on the values some points are hidden.
Unfortunately it's not possible to draw vertical histogram at the moment.

Recharts: Yaxis label cutoff and not aligning in mobile screens

Here is the recharts - Bar chart sample I have tried. https://codesandbox.io/s/simple-bar-chart-forked-8tu41b?file=/src/App.tsx
When width is lesser, Yaxis label is not started from the first, it seems to be cutoff like below. Example full email is "longnametestuser#testdomain.com" but it is starting from "user#testdomain.com". (Note: Even if we add tickFormatter to add ellipse after certain characters in label, it is not aligning unless we give proper width meaning it is cut off at the start. I could not understand it. Please help me to understand and align it.)
And when viewing the chart in the Large and Small mobile screens, chart bars are overriding the labels like this,
I have wrapped the chart inside the responsive container still chart bars and labels are not fitting properly. Any suggestions for this problem would be very helpful.
Thank you in advance.

ChartJS: Fixed width for data-part, the rest for labels

I'm using ChartJS to display multiple charts on a page.
Each chart has a different dataset, and different labels (some have short labels, some have long labels).
Currently the width of the actual 'data-part' (the part of the chart showing e.g. Bars) depends on how much space the labels take. I would like to make all charts have a fixed size for the data-part, and let the labels take up the remaining size.
See for example the following screenshot. Here I display 2 charts, but the actual data-part is different for both, because one has shorter labels than the other.
What I would like is to set for example a fixed width of 400px for the data-part, and let the labels take the remaining space left on the page. That way the charts would be aligned perfectly above each other.
Even better would be if I could set that for each chart the data-part takes a percentage of the width (e.g. 70%), so the labels take the rest (30%).
I have checked the ChartJS documentation, but the only I can find it setting the width for the entire chart-component.
Cheeky solution - you can add a dummy chart before your charts having the same labels.
Let's call this dummy chart as chart D and your main chart as chart M.
In M, you would fix it's width and hide the labels by writing in options -
scales: {y: {ticks: {display: false}}}
Now you have a fixed data width.
In D, you would just display the labels and hide the data part (hiding grid lines, legend, title, etc.).
So now you have two charts side-by-side, one is displaying just the labels and the other displaying the bars, just need to position it in such a way that no matter how long the label is, it does not overlap with M. Repeat the step similarly for all charts and have the same width for M1,M2,M3,...
This is a solution that seemed to work for me.

Unable to change ColorPalette property on Telerik Report graph

I'm using the Telerik Reports graph wizard to create a bar chart. Even though I can change the ColorPalette property to GradientPalette and can choose the desired colors, the results are the same flat single color. What am I doing wrong? Thanks for your help and advice.
The Graph's Color Palette applies gradient coloring on the whole series, not on each of the the data points. I believe you're trying to achieve gradient-colored bars, but this feature is not supported. If in your bar chart you define series groups, then the first bar will be colored using the palette's BeginColor, the last bar will be colored with the palette's EndColor all the bars between them will have solid color, calculated based on their count and offset from the BeginColor towards the EndColor.
The Gradient Palette makes much sense when used in the Choropleth, where the color represents an additional data measure - see a demo here.

SSRS bar chart issue

I am trying to add one box and one line on x-axis. Please look at below bar chart.
I tried using stripline but I cannot set height for stripline. It goes till 100.
Is there any way I can do this?
Unfortunately, SSRS doesn't provide the functionality you're looking for. A stripline is the closest you can get to that, but like you said, you can't control its height. The only way you could simulate this behavior would be to use a Background Image for your stripline, but that may be more work than it's worth. It would require a lot of manual adjustment to get the image to line up on the chart.
I would add a series to the chart using the Stock chart (under Range). In the Series Properties I would set the High value to the height desired for your line (~52 in your example). Ideally this would come from a dataset value.
Set the Low, Open and Close values to 0.
Try two Stripe Lines. First, create the strip line which represents the vertical value you're after. In my case, I made one that was 50% of the graph height off of the Y-Axis.
Chart Properties:
Height of StripeLine:
Once the stripe line is the correct height for the chart, create a 'mask' stripe line along the X-axis that will cover the portion of the Y-axis line you want hidden.
Chart Propterites:
Width of Stripe Mask:
Using these methods, and some really clever expression writing, you should be able to make the line exactly as high, and as wide as you desire.

Resources