Compare commits

...

2 Commits

Author SHA1 Message Date
e16e04c114 combine imports
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-18 23:26:41 -04:00
bbe4d82303 Use bar graph instead of line graph 2024-03-18 23:26:32 -04:00
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,6 @@
# v0.9.7 # v0.9.7
- Fix margin on bottom of page - Fix margin on bottom of page
- Use bar graph instead of line graph
# v0.9.6 # v0.9.6
- Make ammo packs in containers directly navigable in table view - Make ammo packs in containers directly navigable in table view

View File

@ -1,13 +1,12 @@
import { Chart, Title, Tooltip, Legend, LineController, LineElement, PointElement, TimeScale, LinearScale } from 'chart.js' import Chart from 'chart.js/auto'
import 'chartjs-adapter-date-fns' import 'chartjs-adapter-date-fns'
Chart.register(Title, Tooltip, Legend, LineController, LineElement, PointElement, TimeScale, LinearScale)
export default { export default {
initalizeChart (el) { initalizeChart (el) {
const data = JSON.parse(el.dataset.chartData) const data = JSON.parse(el.dataset.chartData)
this.el.chart = new Chart(el, { this.el.chart = new Chart(el, {
type: 'line', type: 'bar',
data: { data: {
datasets: [{ datasets: [{
label: el.dataset.label, label: el.dataset.label,
@ -51,7 +50,8 @@ export default {
stacked: true, stacked: true,
grace: '15%', grace: '15%',
ticks: { ticks: {
padding: 15 padding: 15,
precision: 0
} }
}, },
x: { x: {

View File

@ -4,8 +4,7 @@ defmodule CanneryWeb.ErrorHelpers do
""" """
use PhoenixHTMLHelpers use PhoenixHTMLHelpers
import Phoenix.HTML.Form import Phoenix.{Component, HTML.Form}
import Phoenix.Component
alias Ecto.Changeset alias Ecto.Changeset
alias Phoenix.{HTML.Form, LiveView.Rendered} alias Phoenix.{HTML.Form, LiveView.Rendered}