Skip to content

Commit

Permalink
feat: bar graph entity
Browse files Browse the repository at this point in the history
  • Loading branch information
gitanjli525 committed Sep 24, 2024
1 parent 6490f38 commit 7341ed0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
22 changes: 14 additions & 8 deletions src/screens/NewAnalytics/Graphs/BarGraph/BarGraphTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ type spacingLeft = int
type spacingRight = int

type categories = array<string>
type crosshair = bool
type barWidth = int
type align = string
type color = string
type gridLineWidth = int
Expand All @@ -13,7 +11,10 @@ type gridLineDashStyle = string
type tickmarkPlacement = string
type endOnTick = bool
type startOnTick = bool
type tickInterval = int
type tickWidth = int
type min = int
type max = int
type showInLegend = bool
type name = string

Expand All @@ -29,7 +30,8 @@ type exporting = {
type marker = {
...enabled,
}
type bar = {marker: marker}
type pointPadding = float
type bar = {marker: marker, pointPadding: pointPadding}
type plotOptions = {bar: bar}
type labels = {
align: align,
Expand All @@ -55,18 +57,22 @@ type yAxis = {
gridLineWidth: gridLineWidth,
gridLineColor: gridLineColor,
gridLineDashStyle: gridLineDashStyle,
tickmarkPlacement: tickmarkPlacement,
endOnTick: endOnTick,
startOnTick: startOnTick,
tickInterval: tickInterval,
min: min,
max: max,
}

type xAxis = {
categories: categories,
crosshair: crosshair,
barWidth: barWidth,
labels: labels,
tickWidth: tickWidth,
tickmarkPlacement: tickmarkPlacement,
endOnTick: endOnTick,
startOnTick: startOnTick,
gridLineDashStyle: gridLineDashStyle,
gridLineWidth: gridLineWidth,
gridLineColor: gridLineColor,
min: min,
}

type barGraphOptions = {
Expand Down
15 changes: 10 additions & 5 deletions src/screens/NewAnalytics/Graphs/BarGraph/BarGraphUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,36 @@ let getBarGraphOptions = (barGraphOptions: barGraphPayload) => {
},
xAxis: {
categories,
crosshair: true,
barWidth: 1,
labels: {
align: "center",
style: {
color: "#999",
},
},
tickWidth: 1,
tickmarkPlacement: "on",
endOnTick: false,
startOnTick: false,
gridLineDashStyle: "Dash",
gridLineWidth: 1,
gridLineColor: "#e6e6e6",
min: 0,
},
yAxis: {
title,
gridLineWidth: 1,
gridLineColor: "#e6e6e6",
gridLineDashStyle: "Solid",
tickmarkPlacement: "on",
endOnTick: false,
startOnTick: false,
tickInterval: 25,
min: 0,
max: 100,
},
plotOptions: {
bar: {
marker: {
enabled: false,
},
pointPadding: 0.2,
},
},
series: data,
Expand Down

0 comments on commit 7341ed0

Please sign in to comment.