Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


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);



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


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(