update templui components
This commit is contained in:
parent
d223d76401
commit
78047c7ee8
52 changed files with 162 additions and 123 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// templui component chart - version: v0.101.0 installed by templui v0.101.0
|
||||
// templui component chart - version: v1.2.0 installed by templui v1.2.0
|
||||
// 📚 Documentation: https://templui.io/docs/components/charts
|
||||
package chart
|
||||
|
||||
|
|
@ -36,18 +36,21 @@ type Data struct {
|
|||
}
|
||||
|
||||
type Config struct {
|
||||
Type Variant `json:"type"`
|
||||
Data Data `json:"data"`
|
||||
Options Options `json:"options,omitempty"`
|
||||
ShowLegend bool `json:"showLegend,omitempty"`
|
||||
ShowXAxis bool `json:"showXAxis"`
|
||||
ShowYAxis bool `json:"showYAxis"`
|
||||
ShowXLabels bool `json:"showXLabels"`
|
||||
ShowYLabels bool `json:"showYLabels"`
|
||||
ShowXGrid bool `json:"showXGrid"`
|
||||
ShowYGrid bool `json:"showYGrid"`
|
||||
Horizontal bool `json:"horizontal"`
|
||||
Stacked bool `json:"stacked"`
|
||||
Type Variant `json:"type"`
|
||||
Data Data `json:"data"`
|
||||
Options Options `json:"options,omitempty"`
|
||||
ShowLegend bool `json:"showLegend,omitempty"`
|
||||
ShowXAxis bool `json:"showXAxis"`
|
||||
ShowYAxis bool `json:"showYAxis"`
|
||||
ShowXLabels bool `json:"showXLabels"`
|
||||
ShowYLabels bool `json:"showYLabels"`
|
||||
ShowXGrid bool `json:"showXGrid"`
|
||||
ShowYGrid bool `json:"showYGrid"`
|
||||
Horizontal bool `json:"horizontal"`
|
||||
Stacked bool `json:"stacked"`
|
||||
YMin *float64 `json:"yMin,omitempty"`
|
||||
YMax *float64 `json:"yMax,omitempty"`
|
||||
BeginAtZero *bool `json:"beginAtZero,omitempty"`
|
||||
}
|
||||
|
||||
type Props struct {
|
||||
|
|
@ -64,6 +67,9 @@ type Props struct {
|
|||
ShowYGrid bool
|
||||
Horizontal bool
|
||||
Stacked bool
|
||||
YMin *float64
|
||||
YMax *float64
|
||||
BeginAtZero *bool
|
||||
Class string
|
||||
Attributes templ.Attributes
|
||||
}
|
||||
|
|
@ -103,11 +109,14 @@ templ Chart(props ...Props) {
|
|||
ShowYGrid: p.ShowYGrid,
|
||||
Horizontal: p.Horizontal,
|
||||
Stacked: p.Stacked,
|
||||
YMin: p.YMin,
|
||||
YMax: p.YMax,
|
||||
BeginAtZero: p.BeginAtZero,
|
||||
}
|
||||
}}
|
||||
@templ.JSONScript(dataId, chartConfig)
|
||||
}
|
||||
|
||||
templ Script() {
|
||||
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/chart.min.js?v=" + utils.ScriptVersion }></script>
|
||||
<script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/chart.min.js") }></script>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue