@@ -83,6 +83,7 @@ class ChartJSAxisGrid(BaseModel):
8383 display : bool = True
8484 color : str = "var(--border) / 0.2"
8585 drawBorder : bool = False
86+ drawOnChartArea : bool | None = None
8687
8788
8889class ChartJSAxisTick (BaseModel ):
@@ -103,6 +104,8 @@ class ChartJSAxis(BaseModel):
103104class ChartJSScales (BaseModel ):
104105 x : Annotated [ChartJSAxis , Field (default_factory = ChartJSAxis )]
105106 y : Annotated [ChartJSAxis , Field (default_factory = ChartJSAxis )]
107+ x1 : Annotated [ChartJSAxis | None , Field (default = None )]
108+ y2 : Annotated [ChartJSAxis | None , Field (default = None )]
106109
107110
108111class ChartJSOptions (BaseModel ):
@@ -165,6 +168,20 @@ def build_chart_config_from_attributes(
165168
166169 if chart_config .type in ["bar" , "line" , "scatter" , "bubble" ]:
167170 scales = ChartJSScales ()
171+
172+ if "chart_scales_x" in chart_attributes :
173+ scales .x = ChartJSScales (** chart_attributes ["chart_scales_x" ])
174+
175+ if "chart_scales_y" in chart_attributes :
176+ scales .y = ChartJSScales (** chart_attributes ["chart_scales_y" ])
177+
178+ if chart_config .type in ["line" , "scatter" ]:
179+ if "chart_scales_x1" in chart_attributes :
180+ scales .x1 = ChartJSScales (** chart_attributes ["chart_scales_x1" ])
181+
182+ if "chart_scales_y1" in chart_attributes :
183+ scales .y1 = ChartJSScales (** chart_attributes ["chart_scales_y1" ])
184+
168185 if chart_attributes .get ("chart_stacked" ):
169186 scales .x .stacked = True
170187 scales .y .stacked = True
0 commit comments