Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Metronic v8.1.0 Laravel - Apex Chart does not change values


Hi there,

I'm trying to change the values from file
resources.views.partials.widgets.mixed._widget-10.blade.php

Basically its pretty clear, that the Apex Chart should use the route
from data-kt-chart-url="{{ route('profits') }}".

In the SampleDataController you can easily change the value /11 or /13.

Other values are then returned in the /api/profit route.
However, the diagram does not change a bit.

I've already tried to run the JS and HTML code from the HTML example, and it doesn't work either.

Any quick solution ?

Thanks a lot!


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (5)


Hi,

Could you please try to change the value from resources/samples/sales.json file?
That function from SampleDataController is for sample dummy data.

Thanks



Hi @Faizal,

Just editing sales.json doesn't work.
But meanwhile, after a long struggle, I found out how to change the graphs.

X = Demo version number for example 7

1. Go to /ressources/assets/demoX/js/custom/widgets.js
2. Search for init function "initMixedWidget10"
3. Change Net Profit / Revenue values
4. Save
5. Run "npm run dev --demoX"
6. Clear browser cache
7. Re-Login & see the change

Is there a way to display the graphs dynamically using a controller?
Or do I have to develop it myself ?



Hi,

If the changes are related to js files, you have to recompile the assets using "npm run dev"

The graph is using javascript. You have to develop it yourself. We showed some examples in the sample codes. You have to customize it. More graphs can be found in the HTML version.

Thanks



Hi,
I have already extended the JS code and can now implement the graphs in no time with the help of PHP.

Many Thanks



Hi.

Glad you solved it happy

Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(