Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Sep 6, 2018

This moves some properties out of the options object that is passed to ECharts, into a top level component property of BaseChart.

This allows us to implement more default functionality into BaseChart
(e.g. charting a line series for previousPeriod).

  • Add isGroupedByDate to BaseChart so that we can move formatting logic into charting components
  • Move series into a top level property in BaseChart so that we can add logic to support a Line series for previousPeriod.
  • Also moved: xAxis, yAxis, tooltip, grid

@billyvg billyvg requested review from a team, ayesha-omarali and lynnagara September 6, 2018 20:41
const DEFAULT_TRUNCATE_LENGTH = 80;

// Truncates labels for tooltip
function truncateLabel(seriesName, truncate) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions are moved from app/organizationDiscover/result/utils

return moment(value).format('MMM D, YYYY');
}

function getFormatter({filterEmpty, filterNull, filter, isGroupedByDate, truncate}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd vote to drop filterEmpty and filterNull since you can easily pass a filter function that does the same. I think there's value in keeping this API simple.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This moves some properties out of the `options` object that is passed to ECharts, into
a top level component property of BaseChart.

This allows us to implement more default functionality into BaseChart
(e.g. charting a line series for `previousPeriod`).
@billyvg billyvg force-pushed the ref/charts/start-breakout-of-echarts-options branch from 9502d14 to 34e0c52 Compare September 7, 2018 21:11
@billyvg billyvg merged commit bf31886 into master Sep 10, 2018
@billyvg billyvg deleted the ref/charts/start-breakout-of-echarts-options branch September 10, 2018 21:03
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants