Stockchart Stockevent display error

i have a stockchart with some stockevents added, when i try to open it i get this error in browser console.

the stockchart contains about 6k items (candles) and about 10 stock event entries

syncfusion-blazor-extended-f9a110.min.js:1 Cannot read property 'prototype' of undefined
TypeError: Cannot read property 'prototype' of undefined
    at t.chartModuleInjection (https://localhost:9999/_content/Syncfusion.Blazor/scripts/stockchart-f9a110.min.js:1:160864)
    at e.<anonymous> (https://localhost:9999/_content/Syncfusion.Blazor/scripts/stockchart-f9a110.min.js:1:157657)
    at e.notify (https://localhost:9999/_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js:1:42588)
    at t.e.trigger (https://localhost:9999/_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js:1:81663)
    at t.render (https://localhost:9999/_content/Syncfusion.Blazor/scripts/stockchart-f9a110.min.js:1:157514)
    at t.n.appendTo (https://localhost:9999/_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js:1:98016)
    at Object.initialize (https://localhost:9999/_content/Syncfusion.Blazor/scripts/syncfusion-blazor-extended-f9a110.min.js:1:13211)
    at https://localhost:9999/_framework/blazor.server.js:1:70045
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:9999/_framework/blazor.server.js:1:70011)





<SfStockChart @ref="Chart"
                  Height="@Height"
                  IndicatorType="@IndicatorType"
                  TrendlineType="@TrendlineType"
                  SeriesType="@SeriesType"
                  StockEvents="@CalloutDataSourceInternal">


<StockChartPeriods>
            <StockChartPeriod IntervalType=RangeIntervalType.Minutes Interval="30" Text='30m'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Hours Interval="1" Text='1h'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Hours Interval="6" Text='6h'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Hours Interval="12" Text='12h' Selected="true"></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Hours Interval="24" Text='24h'></StockChartPeriod>
        </StockChartPeriods>

        <StockChartTooltipSettings Enable="true">
        </StockChartTooltipSettings>
        <StockChartCrosshairSettings Enable="true"></StockChartCrosshairSettings>

        <StockChartPrimaryXAxis ValueType="@Syncfusion.Blazor.Charts.ValueType.DateTime">
            <StockChartAxisMajorGridLines Color="Transparent" />
            <StockChartAxisCrosshairTooltip Enable="true" />
        </StockChartPrimaryXAxis>

        <StockChartPrimaryYAxis>
            <StockChartAxisLineStyle Color="Transparent" />
            <StockChartAxisMajorTickLines Color="Transparent" Width="0" />
            <StockChartAxisCrosshairTooltip Enable="true" />
        </StockChartPrimaryYAxis>

        <StockChartAxes>
            <StockChartAxis Name="YAxis1"
                        RowIndex="1" />
        </StockChartAxes>

        <StockChartRows>
            @if (secondChartNeeded)
            {
                <StockChartRow Height="70%" />
                <StockChartRow Height="30%" />
            }
            else
            {
                <StockChartRow Height="100%" />
            }
        </StockChartRows>

        <StockChartSeriesCollection>
            <StockChartSeries DataSource="@AdvancedDataSource"
                          XName=@nameof(CandleDataAdvanced.Time)
                          High=@nameof(CandleDataAdvanced.High)
                          Low=@nameof(CandleDataAdvanced.Low)
                          Open=@nameof(CandleDataAdvanced.Open)
                          Close=@nameof(CandleDataAdvanced.Close)
                          Volume=@nameof(CandleDataAdvanced.Volume)
                          Type="ChartSeriesType.Candle" />

<StockChartSeries Name="customData1"
                          DataSource="@AdvancedDataSource"
                          XName=@nameof(CandleDataAdvanced.Time)
                          YName=@nameof(CandleDataAdvanced.CustomSeries1)
                          PointColorMapping="@CustomDataArrayColors[0]"
                          Fill="@CustomDataArrayColors[0]"
                          YAxisName="YAxis1"
                          Type="ChartSeriesType.Line" />
        </StockChartSeriesCollection>
    </SfStockChart>


6 Replies 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team March 29, 2021 02:24 PM UTC

Hi Andreas, 
  
Greetings from Syncfusion. 
  
We have ensured your reported scenario with attached code snippet. We are unable to replicate an issue from our end. We have prepared sample with 6K data and 10 stock chart events. We have attached the sample and screenshot for your reference. Please specify in which scenario you are facing this error and try to replicate an issue in below sample or provide us an issue reproduced sample so that it will be helpful for us to proceed further. 
  
Screenshot :  
  
 
  
  
Kindly revert us if you have any concerns. 
  
Regards, 
Durga G 



AN Andreas May 5, 2021 09:13 AM UTC

hello,

with the new version released i get a new error when i try to dynamicly add StockChart events

same example and now in v 19 i get the following error 


blazor.server.js:21 [2021-05-05T09:09:35.860Z] Error: System.InvalidOperationException: Object of type 'Syncfusion.Blazor.Charts.SfStockChart' has a property matching the name 'StockEvents', but it does not have [ParameterAttribute] or [CascadingParameterAttribute] applied.
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.ThrowForUnknownIncomingParameterName(Type targetType, String parameterName)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.SetProperties(ParameterView& parameters, Object target)
   at Syncfusion.Blazor.SfDataBoundComponent.SetParametersAsync(ParameterView parameters)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

public List<CalloutData> CalloutDataSource  {get;set;}

CalloutDataSourceInternal.Add(
                        new StockChartStockEvent()
                        {
                            Date = callout.Time,
                            Text = callout.Label,
                            ShowOnSeries = true,
                            PlaceAt = "High",
                            Type = FlagType.Flag,
                            Background = "aqua",
                            Description = "Price: " + callout.Value + " | Label: " + callout.Label + " | Data: " + callout.Data
                        });


DG Durga Gopalakrishnan Syncfusion Team May 6, 2021 12:47 PM UTC

Hi Andreas, 

We have ensured your reported scenario by adding stock event on button click, unfortunately we are unable replicate the reported error. We have attached the tested sample for your reference.  

Code Snippet : 

<SfButton ID="button" @onclick="AddStockEvent" Content="Add"></SfButton> 
<SfStockChart Title="Stock Price"> 
     <StockChartStockEvents> 
        @foreach (SeriesData series in SeriesCollection) 
        { 
                <StockChartStockEventsTextStyle Color=@series.Color></StockChartStockEventsTextStyle> 
            </StockChartStockEvent> 
        } 
    </StockChartStockEvents> 
</SfStockChart> 
@code{ 
public void AddStockEvent(MouseEventArgs args) 
    { 
        SeriesCollection.Add(new SeriesData 
        { 
            Date = new DateTime(1975, 1, 12), 
            Text = "Y1", 
            Description = "Year 1975", 
            Background = "#f48a21", 
            Color = "yellow" 
        }); 
    } 
} 

Screenshots : 

Before Adding 

 

After Adding 

 


Please share the following information which will be more helpful for further analysis and provide you the solution sooner. 
  • Try to reproduce the reported scenario in the above sample.
  • Please share your sample (or) code snippet with full configurations.
  • Share the details if you have done any other customization in your sample.
  • Share your datasource file.
  • Share your nugget package version, .NET version and browser used.

Kindly revert us, if you have any concerns. 

Regards, 
Durga G


AN Andreas May 7, 2021 09:02 AM UTC



before it was possible to use it like this as shown in the initial message: 

<SfStockChart @ref="Chart"
                  Height="@Height"
                  IndicatorType="@IndicatorType"
                  TrendlineType="@TrendlineType"
                  SeriesType="@SeriesType"
                  StockEvents="@CalloutDataSourceInternal">



yes i can do it with the events beeing set in the HTML with a foreach loop but then i get the following error as show in forum entry 
https://www.syncfusion.com/forums/163500/unable-to-cast-object-of-type-system-decimal-to-type-system-double

as i'm using decimal values in the chart not double as it is in your example


DG Durga Gopalakrishnan Syncfusion Team May 10, 2021 12:05 PM UTC

Hi Andreas, 

We have validated your reported scenario with attached snippet. As of now we don’t have option to pass list collection directly to stock chart events, instead you can use foreach to iterate through list collection. We are facing problem while using foreach with decimal type, we have considered this as a bug and logged a defect report. This fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on 25th May 2021. We appreciate your patience until then. You can keep track of the bug from the below feedback link. 
 
 
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.  

Regards, 
Durga G 



DG Durga Gopalakrishnan Syncfusion Team May 25, 2021 02:21 PM UTC

Hi Andreas, 

We are glad to announce that our v19.1.65 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor NuGet package version.  
  
  
Screenshot : 
 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
  
Regards, 
Durga G

Marked as answer
Loader.
Up arrow icon