Closed hughess closed 5 months ago
Latest commit: 9da524d05b14a58afd819a8935010886dae37141
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Name | Link |
---|---|
Latest commit | 9da524d05b14a58afd819a8935010886dae37141 |
Latest deploy log | https://app.netlify.com/sites/evidence-development-workspace/deploys/65696eb6d8a8d60008dbde11 |
Deploy Preview | https://deploy-preview-1366--evidence-development-workspace.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
evidence-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 1, 2023 5:28am |
Had a quick play with this.
Super powerful. Tried something @jdimmerman was asked about recently, and worked pretty nicely.
<AreaChart
data={orders_by_category}
x=month
chartAreaHeight=200
echartsOptions={{ xAxis: { axisLabel: { rotate: 90, interval: 0 } } }}
/>
{{}}
{{xAxis.axisLabel.rotate: 45}}
but it doesn'tThis is really cool
@archiewood I adjusted the indent to 3 spaces - initially I threw in 10 for some reason.
I agree on the code block length, but thinking because it's just a dev mode helper leave it for now. Do you think we should fix it now?
Agreed on the concerns - I was thinking this should be a separate page in the docs, which we can link to from each chart type. That way we can include a bit more of a warning/explanation
Do you think we should fix it now?
no need if not easy
Agreed on the concerns - I was thinking this should be a separate page in the docs, which we can link to from each chart type. That way we can include a bit more of a warning/explanation
sounds very sensible
Couple other tricky things about this atm:
To access the yAxis, you need to use this syntax:
echartsOptions={{
yAxis: [
{
something: 'something'
}
]
}}
To reference a specific series, you need to pass it in the correct order, using empty curly braces for the series you don't want to change. e.g., to change the third series:
echartsOptions={{
series: [
{},
{},
{symbol:'triangle'}
]
}}
showAllXAxisLabels
One other gotcha with this - if you're using a horizontal chart swapXY=true
, the axis you need to make changes on will be flipped in the echarts options. The y-axis in Evidence would be referenced with xAxis
in ECharts and vice versa
Last thing I noticed - it seems to not be possible to change the series type using this approach. I've created an issue with echarts for this: https://github.com/apache/echarts/issues/19349
should / are we able to error handle the eCharts options if you pass an invalid config?
I am writing some rudimentary docs for this
Description
Adds 2 props to chart components:
echartsOptions
: lets you supply an object containing Echarts config, which gets merged with the config of the chartprintEchartsConfig
: (true/false) helper prop for custom chart development - inserts a code block with the current echarts config onto the page so you can see the options used and debug your custom optionsRemaining Issues
Needs work for following components:FunnelChartSankeyChartUSMapNeeds to be incorporated intoechartsCopy.js
,echartsCanvasDownload.js
, andechartsMap.js
Checklist