Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add minInterval option for custom xDomain #240

Merged
merged 12 commits into from
Jun 19, 2019
Merged
Next Next commit
feat: setup test data for discover series
emmacunningham committed Jun 13, 2019
commit ed2a6ece11b3ea0e2a78db293af6c7fbedaaaf01
3,558 changes: 3,558 additions & 0 deletions src/lib/series/utils/test_dataset_discover_per_30s.ts

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions stories/bar_chart.tsx
Original file line number Diff line number Diff line change
@@ -33,6 +33,8 @@ import * as TestDatasets from '../src/lib/series/utils/test_dataset';

import { KIBANA_METRICS } from '../src/lib/series/utils/test_dataset_kibana';

import { TEST_DATASET_DISCOVER } from '../src/lib/series/utils/test_dataset_discover_per_30s';

const dateFormatter = timeFormatter('HH:mm:ss');

const dataGen = new DataGenerator();
@@ -1657,6 +1659,49 @@ storiesOf('Bar Chart', module)
</Chart>
);
})
.add('[test] discover', () => {
const data = TEST_DATASET_DISCOVER.series[0].values;

// const formatter = timeFormatter(niceTimeFormatByDay(1));

// const domain = TEST_DATASET_DISCOVER.ordered;
// const domainStart = Number(domain.min);
// const domainEnd = Number(domain.max);
// const domainMin = data[0].x > domainStart ? domainStart : data[0].x;

// const xDomain = {
// min: domainMin,
// // max: domainMax,
// };

return (
<Chart className={'story-chart'}>
<Settings xDomain={undefined} />
<Axis
id={getAxisId('discover-histogram-left-axis')}
position={Position.Left}
title={TEST_DATASET_DISCOVER.yAxisLabel}
/>
<Axis
id={getAxisId('discover-histogram-bottom-axis')}
position={Position.Bottom}
title={TEST_DATASET_DISCOVER.xAxisLabel}
// tickFormat={formatter}
/>

<HistogramBarSeries
id={getSpecId('discover-histogram')}
xScaleType={ScaleType.Time}
yScaleType={ScaleType.Linear}
xAccessor="x"
yAccessors={['y']}
data={data}
timeZone={'local'}
name={'Count'}
/>
</Chart>
);
})
.add('stacked only grouped areas', () => {
const data1 = [[1, 2], [2, 2], [3, 3], [4, 5], [5, 5], [6, 3], [7, 8], [8, 2], [9, 1]];
const data2 = [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 4], [7, 3], [8, 2], [9, 4]];