JohnySK Posted July 13, 2021 Share Posted July 13, 2021 Hello, Just a question it is possible to achieve that I can send null values to Unichart? To achieve that records will be empty like picture bellow? Some parameter which will allow to do this? afChartReview.uChart.SeriesList.Series[i].Add(null,''); For sure with this I got exception that it can not be converted to double. Thank you for help. With regards, Jan R. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 13, 2021 Share Posted July 13, 2021 3 hours ago, JohnySK said: Just a question it is possible to achieve that I can send null values to Unichart? To achieve that records will be empty like picture bellow? Some parameter which will allow to do this? Hello, Need to analyze. Quote Link to comment Share on other sites More sharing options...
VojkoCendak Posted November 29, 2021 Share Posted November 29, 2021 did you find any solution ? thank you, Vojko Quote Link to comment Share on other sites More sharing options...
VojkoCendak Posted January 28, 2022 Share Posted January 28, 2022 We saw at Ext 7 Sencha fiddle, that if you add null instead of number, chart skips drawing point. just change value let's say 17 -> null ! voila Would that be hard to implement ? Regards, Vojko Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted January 29, 2022 Share Posted January 29, 2022 23 hours ago, VojkoCendak said: We saw at Ext 7 Sencha fiddle, that if you add null instead of number, chart skips drawing point. just change value let's say 17 -> null ! voila Would that be hard to implement ? Regards, Vojko Hello For now please use below workaround. UniChart.pas Line 1819 1 : begin if VarIsNull(ValuesList[1].Value[I]) then Result[I] := 'null' else begin fVal := ValuesList[1].Value[I]; Val := fVal2Float(fVal); Result[I] := Val; end; end; and you can add null values like below Series1.Add(null, '2000') 1 Quote Link to comment Share on other sites More sharing options...
VojkoCendak Posted February 24, 2022 Share Posted February 24, 2022 Better whole function also for TDataSource: function TUniCustomChart.ChartDataToStr(AChartSeries: TUniChartSeries; ADim: Integer): TUniStringArray; var I, xCount : Integer; Ds : TDataSet; S, Val : string; fVal : Double; begin // ADim // 0 = Text Data, // 1 = Numeric Data with AChartSeries do begin if Assigned(FDataSource) then begin if Assigned(FDataSource.DataSet) and FDataSource.DataSet.Active then begin Ds := FDataSource.DataSet; xCount := Ds.RecordCount; if FYValues.FValueSource <> '' then begin DS.DisableControls; try Ds.First; SetLength(Result, xCount); for I := 0 to xCount - 1 do begin case ADim of 0 : begin if FXLabelsSource <> '' then begin if Ds.FieldByName(FXLabelsSource) is TNumericField then Result[I] := fVal2Float(Ds.FieldByName(FXLabelsSource).AsFloat) else Result[I] := StrToJS(Ds.FieldByName(FXLabelsSource).AsString) end else Result[I] := StrToJS(IntToStr(I)); end; 1 : begin if Ds.FieldByName(FYValues.FValueSource).IsNull then // new null *** Result[I] := 'null' else begin fVal := Ds.FieldByName(FYValues.FValueSource).AsFloat; Val := fVal2Float(fVal); Result[I] := Val; end; end; end; Ds.Next; end; finally Ds.EnableControls; end; end; end end else begin SetLength(Result, ValuesList[0].Count); for I := 0 to ValuesList[0].Count - 1 do begin case ADim of 0 : begin S := XLabel[I]; if (S = '') or (S = '""') then // in case no label is provided S := StrToJS(IntToStr(Trunc(ValuesList[0].Value[I]))); Result[I] := S; end; 1 : begin if VarIsNull(ValuesList[1].Value[I]) then // new null *** Result[I] := 'null' else begin fVal := ValuesList[1].Value[I]; Val := fVal2Float(fVal); Result[I] := Val; end; end; end; end; end; end; end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.