forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(legacy-preset-chart-nvd3): time compare and stacked area tooltips (…
…apache#850) * fix: time compare tooltip * refactor: create separate function * refactor: remove fn * fix: area chart tooltip
- Loading branch information
1 parent
4cda799
commit 227e976
Showing
5 changed files
with
376 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ export default { | |
}; | ||
|
||
export { basic } from './stories/basic'; | ||
export { timeFormat } from './stories/timeFormat'; |
233 changes: 233 additions & 0 deletions
233
...ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/timeFormat.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/core'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
|
||
export const timeFormat = () => ( | ||
<SuperChart | ||
chartType="compare" | ||
width={400} | ||
height={400} | ||
datasource={dummyDatasource} | ||
queryData={{ | ||
data: [ | ||
{ | ||
key: ['Africa and Middle East'], | ||
values: [ | ||
{ | ||
x: 1606348800000, | ||
y: 3985, | ||
}, | ||
{ | ||
x: 1606435200000, | ||
y: 5882, | ||
}, | ||
{ | ||
x: 1606521600000, | ||
y: 7983, | ||
}, | ||
{ | ||
x: 1606608000000, | ||
y: 16462, | ||
}, | ||
{ | ||
x: 1606694400000, | ||
y: 5542, | ||
}, | ||
{ | ||
x: 1606780800000, | ||
y: 2825, | ||
}, | ||
], | ||
}, | ||
{ | ||
key: ['Asia'], | ||
values: [ | ||
{ | ||
x: 1606348800000, | ||
y: 34837, | ||
}, | ||
{ | ||
x: 1606435200000, | ||
y: 40718, | ||
}, | ||
{ | ||
x: 1606521600000, | ||
y: 58507, | ||
}, | ||
{ | ||
x: 1606608000000, | ||
y: 110120, | ||
}, | ||
{ | ||
x: 1606694400000, | ||
y: 43443, | ||
}, | ||
{ | ||
x: 1606780800000, | ||
y: 33538, | ||
}, | ||
], | ||
}, | ||
{ | ||
key: ['Australia'], | ||
values: [ | ||
{ | ||
x: 1606348800000, | ||
y: 12975, | ||
}, | ||
{ | ||
x: 1606435200000, | ||
y: 18471, | ||
}, | ||
{ | ||
x: 1606521600000, | ||
y: 17880, | ||
}, | ||
{ | ||
x: 1606608000000, | ||
y: 52204, | ||
}, | ||
{ | ||
x: 1606694400000, | ||
y: 26690, | ||
}, | ||
{ | ||
x: 1606780800000, | ||
y: 16423, | ||
}, | ||
], | ||
}, | ||
{ | ||
key: ['Europe'], | ||
values: [ | ||
{ | ||
x: 1606348800000, | ||
y: 127029, | ||
}, | ||
{ | ||
x: 1606435200000, | ||
y: 177637, | ||
}, | ||
{ | ||
x: 1606521600000, | ||
y: 172653, | ||
}, | ||
{ | ||
x: 1606608000000, | ||
y: 203654, | ||
}, | ||
{ | ||
x: 1606694400000, | ||
y: 79200, | ||
}, | ||
{ | ||
x: 1606780800000, | ||
y: 45238, | ||
}, | ||
], | ||
}, | ||
{ | ||
key: ['LatAm'], | ||
values: [ | ||
{ | ||
x: 1606348800000, | ||
y: 22513, | ||
}, | ||
{ | ||
x: 1606435200000, | ||
y: 24594, | ||
}, | ||
{ | ||
x: 1606521600000, | ||
y: 32578, | ||
}, | ||
{ | ||
x: 1606608000000, | ||
y: 34733, | ||
}, | ||
{ | ||
x: 1606694400000, | ||
y: 71696, | ||
}, | ||
{ | ||
x: 1606780800000, | ||
y: 166611, | ||
}, | ||
], | ||
}, | ||
{ | ||
key: ['North America'], | ||
values: [ | ||
{ | ||
x: 1606348800000, | ||
y: 104596, | ||
}, | ||
{ | ||
x: 1606435200000, | ||
y: 109850, | ||
}, | ||
{ | ||
x: 1606521600000, | ||
y: 136873, | ||
}, | ||
{ | ||
x: 1606608000000, | ||
y: 133243, | ||
}, | ||
{ | ||
x: 1606694400000, | ||
y: 327739, | ||
}, | ||
{ | ||
x: 1606780800000, | ||
y: 162711, | ||
}, | ||
], | ||
}, | ||
], | ||
}} | ||
formData={{ | ||
queryFields: { | ||
metrics: 'metrics', | ||
groupby: 'groupby', | ||
}, | ||
datasource: '24771__table', | ||
vizType: 'compare', | ||
urlParams: {}, | ||
timeRangeEndpoints: ['inclusive', 'exclusive'], | ||
granularitySqla: '__time', | ||
timeGrainSqla: 'P1D', | ||
timeRange: 'Last week', | ||
metrics: ['random_metric'], | ||
adhocFilters: [], | ||
groupby: ['dim_origin_region'], | ||
timeseriesLimitMetric: null, | ||
orderDesc: true, | ||
contribution: false, | ||
rowLimit: 10000, | ||
colorScheme: 'd3Category10', | ||
labelColors: {}, | ||
xAxisLabel: '', | ||
bottomMargin: 'auto', | ||
xTicksLayout: 'auto', | ||
xAxisFormat: 'smart_date', | ||
xAxisShowminmax: false, | ||
yAxisLabel: '', | ||
leftMargin: 'auto', | ||
yAxisShowminmax: false, | ||
yLogScale: false, | ||
yAxisFormat: 'SMART_NUMBER', | ||
yAxisBounds: [null, null], | ||
rollingType: 'None', | ||
comparisonType: 'values', | ||
resampleRule: null, | ||
resampleMethod: null, | ||
annotationLayers: [], | ||
appliedTimeExtras: {}, | ||
where: '', | ||
having: '', | ||
havingFilters: [], | ||
filters: [], | ||
}} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.