Skip to content

Commit

Permalink
feat(chart): fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
SNosenko authored and SNosenko committed Sep 29, 2021
1 parent 7ad1caf commit 9d1e888
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions packages/chart/src/docs/Component.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -543,16 +543,16 @@ import Changelog from '../../CHANGELOG.md';



const responsiveContainerId = 'responsiveContainer';
const cartesianGridId = 'cartesianGrid';
const composeChartId = 'composeChart';
const xAxisId = 'xAxis';
const yAxisId = 'yAxis';
const legendId = 'legend';
const tooltipId = 'tooltip';
const brushId = 'brush';
const lineId = 'line';
const areaId = 'area';
const responsiveContainerId = 'responsiveContainerId';
const cartesianGridId = 'cartesianGridId';
const composeChartId = 'composeChartId';
const xAxisId = 'xAxisId';
const yAxisId = 'yAxisId';
const legendId = 'legendId';
const tooltipId = 'tooltipId';
const brushId = 'brushId';
const lineId = 'lineId';
const areaId = 'areaId';



Expand Down Expand Up @@ -666,9 +666,9 @@ import Changelog from '../../CHANGELOG.md';
const areaIcon = select('icon', iconTypes, 'filledCircle', areaId);
const areaOffset = number('offset', 0.1, {min: 0, max: 1, step: 0.1}, areaId);

const areaColor_1 = text('gradient.points.color', 'rgba(0, 112, 224, 0.2)', areaId);
const areaColorOpacity_1 = number('gradient.points.opacity', 1, {min: 0, max: 1, step: 0.1}, areaId);
const areaColor_2 = text('gradient.points.color', 'rgba(0, 128, 255, 0)', areaId);
const areaColor_1 = text('gradient.points.color above', 'rgba(0, 112, 224, 0.2)', areaId);
const areaColorOpacity_1 = number('gradient.points.opacity of color above', 1, {min: 0, max: 1, step: 0.1}, areaId);
const areaColor_2 = text('gradient.points.color below', 'rgba(0, 128, 255, 0)', areaId);
const areaColorOpacity_2 = number('gradient opacity of color below', 1, {min: 0, max: 1, step: 0.1}, areaId);

const areaName = text('properties.name', 'предыдущий период', areaId);
Expand Down Expand Up @@ -1247,7 +1247,7 @@ import Changelog from '../../CHANGELOG.md';
legend,
brush,
labels: labelsLineChart,
series: [lineChart, areaChart]
series: [areaChart]
};

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/chart/src/hooks/useSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const useSettings = (options: OptionsProps): Settings => {
settings.legend.margin.top = setLegendMargin(brush, legend);

settings.series = setGradientCharts(series);
const [initData, chartsNames, count] = setDatas(series, labels);
const [initData, chartsNames, count] = setDatas(settings.series, labels);
settings.composeChart.margin = setComposedChartsMargin(composeChart, legend, brush, xAxis);
settings.series = sortByIndex(series);
settings.series = sortByIndex(settings.series);

setState(settings);
setData(initData);
Expand Down
1 change: 1 addition & 0 deletions packages/chart/src/hooks/useSettings/utils/setDatas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ export const setDatas = (
return null;
});
}

return [initData, chartsNames, count];
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export const setGradientCharts = (series: SeriaProps[]): SeriaProps[] => {
});
}

const obj = {
accum.push({
...item,
zIndex: -100,
chart: 'gradient' as const,
chart: 'gradient',
hideLegend: true,
hideTooltip: true,
properties: {
Expand All @@ -31,8 +31,7 @@ export const setGradientCharts = (series: SeriaProps[]): SeriaProps[] => {
fill,
},
data: newData || item.data,
};
accum.push(obj);
});
}

accum.push(item);
Expand Down

0 comments on commit 9d1e888

Please sign in to comment.