Jump to content

Pie Chart 2 Series Created at Runtime with same Datasource - Help


andyhill

Recommended Posts

I create and assign 2 Pie Series to a Chart at runtime with both of them using the same DataSource, problem it is not working correctly even though there is valid data - please advise - thanks.  

 

Also I do not want to see the 0 (screen shot attached).

 

...

 

SrvdAbdnChart: TUniChart;

 

...

 

  public
    { Public declarations }
    SrvdSeries, AbdnSeries: TUniPieSeries;
 

...

 

      //////////////////////////////////////////////////////////////////////////
      // Pie Graph Init
      //////////////////////////////////////////////////////////////////////////
      SrvdAbdnChart.SeriesList.Clear;
      SrvdAbdnChart.TitleAlign:= taCenter;
      SrvdAbdnChart.Title.Text.Add('Serviced / Abandoned (avg)');
      SrvdAbdnChart.Legend.Visible:= False;
      SrvdAbdnChart.Animate:= True;
      SrvdAbdnChart.Shadow:= True;
      SrvdAbdnChart.ShadowOffset:= 1;
      SrvdAbdnChart.AutoSize:= True;
 
      //////////////////////////////////////////////////////////////////////////
      // Series Init
      //////////////////////////////////////////////////////////////////////////
      FetchSrvdAbdnRowSet(Self); // FETCH DATA
      SrvdSeries:= TUniPieSeries.Create(MainForm);
      SrvdSeries.Name:= 'nSrvdSeries';
      SrvdSeries.DataSource:= UniMainModule.SrvdAbdnDataSource;
      SrvdSeries.YValues.ValueSource:= 'ServicedCalls';
      SrvdAbdnChart.SeriesList.Add(SrvdSeries);
 
      //////////////////////////////////////////////////////////////////////////
      // Series Init
      //////////////////////////////////////////////////////////////////////////
      UniMainModule.SrvdAbdnQuery.First; // GOTO FIRST RECORD (in case above left datasource at eof)
      AbdnSeries:= TUniPieSeries.Create(MainForm);
      AbdnSeries.Name:= 'nAbdnSeries';
      AbdnSeries.DataSource:= UniMainModule.SrvdAbdnDataSource;
      AbdnSeries.YValues.ValueSource:= 'AbandonedCalls';
      SrvdAbdnChart.SeriesList.Add(AbdnSeries);
 
      //////////////////////////////////////////////////////////////////////////
      SrvdAbdnChart.RefreshData;
 

post-5752-0-44429900-1509258793_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...