Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/line-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ class LineChart extends AbstractChart {
} = config
const output = []
const datas = this.getDatas(data)
const baseHeight = this.calcBaseHeight(datas, height)
data.map((dataset, index) => {
dataset.data.map((x, i) => {
const cx =
paddingRight + (i * (width - paddingRight)) / dataset.data.length
const cy =
(height / 4) *
3 *
(1 - (x - Math.min(...datas)) / this.calcScaler(datas)) +
paddingTop
(baseHeight - this.calcHeight(x, datas, height)) / 4 * 3 + paddingTop
const onPress = () => {
if (!onDataPointClick) {
return
Expand Down