SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0 votes
229 views

Has anyone encountered this before?

XamlParseException: Unexpected record in Baml stream. Trying to add to SciChartSurface which is not a collection or has a TypeConverter.

<DataTemplate x:Key="SciLineChartTemplate"><Grid><s:SciChartSurface ...

0 votes
638 views

hi everyone
when i use utf8 string such as ‘محور’ = axis in persian sciChart lookLike this .
i tried different fonts but did not work .

 SciChartBuilder.init(this@Main2Activity)

    // Obtain the SciChartBuilder instance
    val sciChartBuilder = SciChartBuilder.instance()

    val myCustomFont: Typeface? = ResourcesCompat.getFont(this, R.font.maryam)
    val fontStyle = FontStyle(myCustomFont, 50f, Color.RED)

    val s = String("محور".toByteArray(Charsets.UTF_8))

    xAxis = sciChartBuilder.newNumericAxis().withAxisTitleStyle(fontStyle).withAxisTitle(s).withGrowBy(DoubleRange(0.1, 0.1)).build()
    yAxis = sciChartBuilder.newNumericAxis().withAxisTitle("this is y").withGrowBy(DoubleRange(0.1, 0.1)).build()

    val dataSeries = XyDataSeries(Double::class.javaObjectType, Double::class.javaObjectType)
    dataSeries.append(arrayOf(0.0, 2.0, 4.0, 6.0, 8.0, 10.0), arrayOf(1.0, 5.0, -5.0, -10.0, 10.0, 3.0))

    rs = sciChartBuilder.newColumnSeries()
            .withDataSeries(dataSeries)
            .withStrokeStyle(ColorUtil.White, 3f, false)
            .build()

    surface.chartModifiers.add(sciChartBuilder.newModifierGroupWithDefaultModifiers().build())

    UpdateSuspender.using(surface) {
        Collections.addAll<IAxis>(surface.xAxes, xAxis)
        Collections.addAll<IAxis>(surface.yAxes, yAxis)
        Collections.addAll<FastColumnRenderableSeries>(surface.renderableSeries, rs)

    }

and the result :

result image

0 votes
1k views

Hi,

I’m evaluating SciChart for use in a production app.

Is there any way to log exceptions generated by SciChart? Currently I’m logging all handled and unhandled exceptions in my app to my server so that issues can be flagged without users having to manually submit support tickets. SciChart is printing internal exceptions to console – is there any way to override that with our own error handling mechanism? If not, how should we monitor for production errors generated internally by SciChart?

Thanks

  • Mike Liu asked 1 year ago
  • last active 1 year ago
0 votes
0 answers
1k views

Hello!
I’m writting an app with using SciChart Surface. After little changes in XAML code, that had no effect on surface, those surface show nothing. I turned all made changes back to correct working version but this didn’t help. What can it be? I attach veiw of surface that a see now. (Theme is presetup “Electric”)

0 votes
4k views

I have 2 charts in my application. They work fine until I add an event to the chart (xaml). The Designer gives an Unhandled Exception with the following details

System.ArgumentException
An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Expression.DesignModel.Metadata.MemberCollection.get_FieldIndex()
at Microsoft.Expression.DesignModel.Metadata.MemberCollection.CreateField(String fieldName, MemberKey& key)
at Microsoft.Expression.DesignModel.Metadata.MemberCollection.CreateMember(MemberType memberTypes, String memberName, MemberKey& key)
at Microsoft.Expression.DesignModel.Metadata.MemberCollection.TryGetCachedMember(MemberType memberTypes, String memberName, Boolean create, IMember& member)
at Microsoft.Expression.DesignModel.Metadata.MemberCollection.GetMember(MemberType memberTypes, String memberName, MemberAccessTypes access)
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.GetMember(MemberType memberTypes, String memberName, MemberAccessTypes access)
at Microsoft.Expression.Markup.XamlTypeHelper.GetPropertyKey(XamlParserContext parserContext, ITextLocation lineInformation, XmlNamespace xmlNamespace, String typeAndPropertyName, XmlNamespace targetTypeNamespace, IType targetTypeId, MemberType memberTypes, MemberType defaultType, Boolean allowProtectedPropertiesOnTargetType)
at Microsoft.Expression.Markup.XamlParser.GetPropertyKey(XamlParserContext parserContext, XmlElementReference xmlElementReference, XmlElement xmlElement, XmlAttribute attribute, IType targetType, Boolean allowProtectedPropertiesOnTargetType, IProperty& propertyKey)
at Microsoft.Expression.Markup.XamlParser.AddPropertiesAndChildren(XamlParserContext parserContext, DocumentCompositeNodeReference nodeReference, XmlElementReference xmlElementReference, XmlElement xmlElement, Predicate
1 propertyFilter)
at Microsoft.Expression.Markup.XamlParser.AddPropertiesAndChildren(XamlParserContext parserContext, DocumentCompositeNodeReference nodeReference, XmlElementReference xmlElementReference, XmlElement xmlElement)
at Microsoft.Expression.Markup.XamlParser.ParseCompositeElement(XamlParserContext parserContext, IDocumentNodeReference nodeReference, IType typeId, XmlElementReference xmlElementReference, XmlElement xmlElement)
at Microsoft.Expression.Markup.XamlParser.ParseElementContent(XamlParserContext parserContext, IDocumentNodeReference nodeReference, IType typeId, XmlElementReference xmlElementReference, XmlElement xmlElement)
at Microsoft.Expression.Markup.XamlParser.ParseElement(XamlParserContext parserContext, IDocumentNodeReference nodeReference, XmlElementReference xmlElementReference, XmlElement xmlElement, DocumentNode& node)
at Microsoft.Expression.Markup.XamlParser.ParseRegion(IReadableSelectableTextBuffer textBuffer, DocumentNode parentNode, DocumentNode oldNode, ITextRange span, IList1& errors)
at Microsoft.Expression.Markup.XamlLanguageService.IncrementalParse(ITextChangesTracker textChanges, IList
1 errorsAndWarnings, IList`1& newErrors)
at Microsoft.Expression.Markup.MarkupDocument.CommitTextEdits(Boolean forceUpdateIfWarnings)
at Microsoft.Expression.DesignSurface.View.SceneView.CommitTextEditsInternal(Boolean forceUpdateIfWarnings)
at Microsoft.Expression.DesignSurface.View.SceneView.SynchronizeTextEdits()
at Microsoft.Expression.DesignSurface.View.SceneView.StopTimerAndCommitTextEdits()
at Microsoft.Expression.DesignSurface.View.SceneView.TextCommitTimeoutTimer_Tick(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at Microsoft.Expression.DesignHost.Isolation.DesignerProcess.RunApplication()
at Microsoft.Expression.DesignHost.Isolation.DesignerProcess.<>c__DisplayClass2.b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

The Chart code is as below. If I remove the Preview mouse down and reload then it woks fine.

        <s:SciChartSurface x:Name="sciChartFull" s:ThemeManager.Theme="Chrome" Grid.Column="0" PreviewMouseDown="sciChartFull_PreviewMouseDown"  >
            <s:SciChartSurface.RenderableSeries>
                <s:FastLineRenderableSeries x:Name="lineSeriesFull" SeriesColor="#FFBB6464" />
                <s:XyScatterRenderableSeries x:Name="pointSeriesFull">
                    <s:XyScatterRenderableSeries.PointMarker>
                        <s:EllipsePointMarker Width="5" Height="5" Fill="#FF04571B" Stroke="#FF04571B" StrokeThickness="1"></s:EllipsePointMarker>
                    </s:XyScatterRenderableSeries.PointMarker>
                </s:XyScatterRenderableSeries>
            </s:SciChartSurface.RenderableSeries>
            <s:SciChartSurface.XAxis>
                <s:TimeSpanAxis DrawMajorGridLines="False" DrawMinorGridLines="False" />
            </s:SciChartSurface.XAxis>
            <s:SciChartSurface.YAxis>
                <s:NumericAxis DrawMajorGridLines="False" DrawMinorGridLines="False" Visibility="Collapsed"/>
            </s:SciChartSurface.YAxis>
        </s:SciChartSurface>
Showing 5 results
This template supports the sidebar's widgets. Add one or use Full Width layout.