Hello everyone, got a problem working with the canvas. The date isn't showing properly (organized by month then day) and I was wondering if theres anything I could use to have it fixed.
Here is how the chart is looking like:
And here is the Expression Editor at the moment:
filters ungrouped=true
| essql
query="SELECT count(1) as qtd_acessos, convert(create_time, date) as ano_mes, CASE WHEN actual_reservation_duration is not null THEN 'Manual' ELSE 'Automatic' END as \"Tipos de Teste\" FROM \"database\"
group by ano_mes, \"Tipos de Teste\""
| mapColumn name="ano_mes" expression={getCell "ano_mes" | formatdate "MMM/D"}
| pointseries x="ano_mes" y="qtd_acessos" color="Tipos de Teste" text="qtd_acessos"
| plot defaultStyle={seriesStyle lines="3" points="3"}
font={font align="left" color="#FFFFFF" family="'Open Sans', Helvetica, Arial, sans-serif" italic=false size=14 underline=false weight="normal"} yaxis=false legend="nw" palette={palette "red" "blue" gradient=true}
| render css=".canvasRenderEl .valueLabel { margin-top: -5px; color: white;}"
Thanks in advance!
bhavyarm
(Bhavya R M)
June 17, 2022, 6:57pm
#2
Hello,
What is the format in which you wanted date to get displayed?
Thanks,
Bhavya
1 Like
SamuelSMendes
(Samuel S. Mendes Soares)
June 20, 2022, 12:30pm
#3
Just date, with no time data. But everytime I use format so the time wont show up that mess of days happens...
SamuelSMendes
(Samuel S. Mendes Soares)
June 24, 2022, 11:51am
#4
Made it with some formating and css.
First by treating the create_time with substring:
substring(convert(create_time, varchar),6,5)
This way the date order got a bit fixed but generated another problem that the dates now was completed inverted:
But even though it was inverted, since it was in order I could use css properly so I made it.
Here is the css:`
css=".canvasRenderEl .flot-base {
transform: scale(-1, 1);
}
.canvasRenderEl .flot-x-axis div{
transform: scaleX(-1);
}
.canvasRenderEl .flot-x-axis{
margin-top: -10px;
position: left;
transform: scaleX(-1);
}"
And here is the result:
Since it worked I'll be posting as a solution, in any case thanks for reaching out @bhavyarm .
system
(system)
Closed
July 22, 2022, 11:51am
#5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.