Graphics Error

For example ;
I want to draw graphics using widget-38.js file.
protected override Task OnInitializedAsync()
{
return base.OnInitializedAsync();
}
method in widget-38.js file data: [54, 42, 75, 110, 23, 87, 50] and categories: ['E2E', 'IMC', 'SSMC', 'SSBD', 'ICCD', ' PAN', 'SBN'], how can I send data as parameter in OnInitializedAsync in method.

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 (4)

My problem still persists. I'm waiting for your help

Hi,

I guess that you do not need to add your data as a parameter for OnInitializedAsync.

Firstly, you need to fetch data from your data source, and then you can use fetched data for widget configuration.

You can check the example in Starterkit/Pages/FetchData.razor.

I want to show data graphically. How can I send the data I have obtained to the js file. Graphical data exists in js files by default. I want to send data as parameter to js file.

You can add parameters for the js init function.

init: function (data, categories) {
...
}

And then just pass your data and categories as it is shown below:

await JS.InvokeVoidAsync("KTChartsWidget38.init", data, categories);

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  :(