File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ const submitSearch = () => {
9797/*************************************************************
9898 * Chart
9999 *************************************************************/
100- const CHART_OPTIONS = {
100+ const DEFAULT_CHART_OPTIONS = {
101101 animation : false ,
102102 barPercentage : 1 ,
103103 base : 0 ,
@@ -197,6 +197,7 @@ const renderCharts = () => {
197197 const ctx = chart . getContext ( "2d" ) ;
198198 const data = chart . dataset . value ;
199199 const type = chart . dataset . type ;
200+ const options = chart . dataset . options ;
200201
201202 if ( ! data ) {
202203 return ;
@@ -206,7 +207,7 @@ const renderCharts = () => {
206207 new Chart ( ctx , {
207208 type : type || "bar" ,
208209 data : JSON . parse ( chart . dataset . value ) ,
209- options : CHART_OPTIONS ,
210+ options : options ? JSON . parse ( options ) : DEFAULT_CHART_OPTIONS ,
210211 } )
211212 ) ;
212213 } ) ;
Original file line number Diff line number Diff line change 6565 {% csrf_token %}
6666
6767 {% if actions_detail %}
68- < div class ="bg-gray-50 flex justify-end mb-4 p-3 rounded-md dark:bg-gray-800 ">
68+ < div class ="bg-gray-50 flex justify-end -mt-6 mb-4 p-3 rounded-md dark:bg-gray-800 ">
6969 {% for action in actions_detail %}
7070 < a href ="{{ action.path }} " class ="bg-white text-gray-500 border cursor-pointer flex font-medium items-center px-3 py-2 mr-3 rounded-md shadow-sm text-sm dark:bg-gray-900 dark:border dark:border-gray-700 dark:text-gray-400 "
7171 {% for attr_name, attr_value in action.attrs.items %}
Original file line number Diff line number Diff line change 11< div class ="relative w-full{% if class %} {{ class }}{% endif %} ">
2- < canvas class ="chart " data-type ="bar " data-value ="{{ data }} " {% if width %}width ="{{ width }} "{% endif %} {% if height %}height ="{{ height }} "{% endif %} > </ canvas >
2+ < canvas class ="chart " {% if options %}data-options =" {{ options }} " {% endif %} data-type ="bar " data-value ="{{ data }} " {% if width %}width ="{{ width }} "{% endif %} {% if height %}height ="{{ height }} "{% endif %} > </ canvas >
33</ div >
Original file line number Diff line number Diff line change 11< div class ="relative w-full{% if class %} {{ class }}{% endif %} ">
2- < canvas class ="chart " data-type ="line " data-value ="{{ data }} " {% if width %}width ="{{ width }} "{% endif %} {% if height %}height ="{{ height }} "{% endif %} > </ canvas >
2+ < canvas class ="chart " {% if options %}data-options =" {{ options }} " {% endif %} data-type ="line " data-value ="{{ data }} " {% if width %}width ="{{ width }} "{% endif %} {% if height %}height ="{{ height }} "{% endif %} > </ canvas >
33</ div >
You can’t perform that action at this time.
0 commit comments