Open SalvatoreSA opened 1 week ago
For now I worked around it without modifying this repo, but obviously it's pretty "ugly".
`import javax.annotation.PostConstruct;
import org.springframework.stereotype.Component;
import io.quickchart.QuickChart;
@Component public class ChartBuilder {
@PostConstruct
public void test() {
this.buildChart();
}
public void buildChart() {
QuickChart chart = new QuickChart("https", "quickchart.io/apex-charts", 443);
String apexConfig = "{" +
" chart: {" +
" type: 'line'," +
" height: 350" +
" }," +
" series: [{" +
" name: 'Vendite'," +
" data: [10, 20, 15, 25, 35, 30]" +
" }]," +
" xaxis: {" +
" categories: ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu']" +
" }" +
"}";
chart.setConfig(apexConfig);
String url = chart.getUrl().replace("/chart", "/render").replace("?w=500&h=300&devicePixelRatio=1.0&c", "?config");
System.out.println(url);
}
}`
Hi @SalvatoreSA, you are correct, unfortunately you'll have to construct the URL yourself for the apex charts endpoint.
Then I suppose you can close the ticket unless further information is available. Thanks!
Quickchart's main docs specify it supports apexchart server-side rendering here. That is what we're mostly interested in, and we would like to use this repo to do that from our backend as we already use apexcharts in frontend and we'd rather not split the logic.
I haven't found anything mentioning apexcharts in this documentation or in the actual classes, am I right? If so, would it be doable implementing it? From what I see it's about modifying the url to include "/apex-charts/" in the beginning and using .setConfig to use an apexcharts config?
Thanks in advance!