Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
pie-charts
Can anyone recommend a good javascript based pie-chart that is easy to update frequently, and presents the chart as an svg?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Re: pie-charts
I don’t see how to save a chart as svg in the official docs, but this has instructions
Offline
Re: pie-charts
Thanks for all your suggestions!!! I’m testing all the above and www.chartjs.org.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
After a lot of research, I (unfortunately) found that google charts are the easiest as they use the familiar spreadsheet format and update the embedded chart automatically, on any data changes.
The issue that I have is that at the moment my CSP in htaccess is blocking them from embedding. I checked the net and I’m yet to find a directive that can just exclude the charts.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
colak wrote #339876:
After a lot of research, I (unfortunately) found that google charts are the easiest as they use the familiar spreadsheet format and update the embedded chart automatically, on any data changes.
The issue that I have is that at the moment my CSP in htaccess is blocking them from embedding. I checked the net and I’m yet to find a directive that can just exclude the charts.
solved:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
Offline
Re: pie-charts
agovella wrote #339878:
That’s cryptic. :-)
How’d you do it?
I added an exception for google subdomains.
Here’s the complete code
Header set Content-Security-Policy: "default-src 'self' data: 'unsafe-inline' 'unsafe-eval' font-src 'self'; manifest-src 'self'; object-src 'none'; img-src 'self' data: 'unsafe-inline' 'unsafe-eval' *.vimeo.com *.youtube.com *.ytimg.com *.youtube-nocookie.com *.vimeocdn.com *.google.com; frame-src 'self' data: *.vimeo.com *.youtube.com *.ytimg.com *.youtube-nocookie.com *.vimeocdn.com *.google.com;"
As is usual, the resolution of one issue, also reveals other problems. It appears that google sheets charts are not responsive. I’m trying to find a solution online as the css I have implemented does not appear to work.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
Google is #Enshittification personified!
…. texted postive
Offline
Re: pie-charts
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
bici wrote #339880:
Google is #Enshittification personified!
So… you rightfully made me feel guilty, and I’m moving to echarts.apache.org/en/index.html
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
And here’s the page. I’m still trying to figure out how to customise the colours, but the data is there.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
colak wrote #339891:
I’m still trying to figure out how to customise the colours, but the data is there.
From memory, and don’t take this as gospel, pie chart colours can be specified in your var block:
colors: ['#ff0000', '#00ff00', '#0000ff', '#ffff00', '#00ffff']
Offline
Re: pie-charts
gaekwad wrote #339893:
From memory, and don’t take this as gospel, pie chart colours can be specified in your
varblock:
colors: ['#ff0000', '#00ff00', '#0000ff', '#ffff00', '#00ffff']...
Hi Pete thanks so much for jumping in.
It was actually simpler than that! All I needed to do was to select the item in the series and add the colour. Sample code:
{ value: 13, name: 'Other' , itemStyle: {color: '#eeeeee'}}
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: pie-charts
Those are pretty cool. Wish I had a record of 21 years of my projects. That’d be really cool to see.
Offline