Skip to content

Commit

Permalink
feat(ebay-area-chart): refactor existing area chart to design specs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehobi authored and agliga committed Jan 16, 2025
1 parent 2cb19b1 commit 96f2732
Show file tree
Hide file tree
Showing 13 changed files with 778 additions and 569 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-experts-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/ebayui-core": minor
---

Add area chart
26 changes: 24 additions & 2 deletions src/common/charts/shared.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const chartFontFamily = '"Market Sans", Arial, sans-serif',
backgroundColor = "var(--color-background-primary)",
gridColor = "var(--color-data-viz-grid)",
labelsColor = "var(--color-data-viz-labels)",
legendColor = "var(--color-data-viz-legend)",
labelsColor = "var(--color-foreground-secondary)",
legendColor = "var(--color-foreground-primary)",
legendInactiveColor = "var(--color-data-viz-legend-inactive)",
legendHoverColor = "var(--color-data-viz-legend-hover)",
tooltipBackgroundColor = "var(--color-background-primary)",
Expand Down Expand Up @@ -79,6 +79,7 @@ export const chartFontFamily = '"Market Sans", Arial, sans-serif',
const color = strokeColorMapping[i % strokeColorMapping.length];
series[i].lineColor = color;
series[i].borderColor = color;
series[i].fillOpacity = 1;
}
},
setDonutColors = function (series: any) {
Expand Down Expand Up @@ -110,4 +111,25 @@ export const chartFontFamily = '"Market Sans", Arial, sans-serif',
});

return colors.map((color: any) => color.lineColor);
},
setSeriesMarkerStyles = function (series: Highcharts.PlotAreaOptions[]) {
series.forEach((s, i) => {
s.zIndex = series.length - i;
s.marker = {
symbol: "circle",
lineWidth: 1,
fillColor: "black",
lineColor: "white",
states: {
hover: {
animation: { duration: 0 },
radius: 4,
lineWidth: 2,
},
normal: {
animation: false,
},
},
};
});
};
6 changes: 6 additions & 0 deletions src/components/ebay-area-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
</h1>

The area chart displays one to five series of data points as an interactive stacked area chart

## Examples and Documentation

- [Storybook](https://ebay.github.io/ebayui-core/?path=/docs/charts-ebay-area-chart)
- [Storybook Docs](https://ebay.github.io/ebayui-core/?path=/docs/charts-ebay-area-chart)
- [Code Examples](https://github.com/eBay/ebayui-core/tree/master/src/components/ebay-area-chart/examples)
143 changes: 0 additions & 143 deletions src/components/ebay-area-chart/area-chart.stories-ignore.ts

This file was deleted.

Loading

0 comments on commit 96f2732

Please sign in to comment.