Woutero Posted August 23 Share Posted August 23 I cannot get UniCharts to work in C++ Builder 10.4, target windows 64bit. I have done the following: In Main.h I have class TForm1 : public TUniForm { __published: // IDE-managed Components TUniChart *UniChart1; TUniButton *UniButton1; private: // User declarations public: // User declarations __fastcall TForm1(TComponent* Owner); }; //--------------------------------------------------------------------------- TForm1 *Form1(void); TUniLineSeries *LineSeries; //--------------------------------------------------------------------------- In Main.cpp I have: void __fastcall TForm1::UniButton1Click(TObject *Sender) { int I,Val; String Header; TUniLineSeries *LineSeries = new TUniLineSeries(UniChart1); LineSeries->Parent = UniChart1; for (I=0; I<=11; I++) { Header = IntToStr(2000 + I); Val = Random(100) + 50; LineSeries->Add(Val, Header); } } Similar code in Delphi 10.4 worked fine, but not in C++ Builder 10.4? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 23 Share Posted August 23 Hello, Please specify first, which edition and build of uniGUI are you using? Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 23 Author Share Posted August 23 Hi Sherzod! I'm using uniGUI 1.90 Build 1535 Any suggestions? Everything works fine in Delphi 10.4 but not in C++ Builder 10.4? Thanks so much Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 23 Share Posted August 23 Just now, Woutero said: I'm using uniGUI 1.90 Build 1535 Not trial? Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 23 Author Share Posted August 23 Forgot to say that I'm using the Complete Professional version Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 23 Share Posted August 23 Just now, Woutero said: Forgot to say that I'm using the Complete Professional version Please adjust your forum email address: Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 23 Author Share Posted August 23 Done 1 Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 24 Author Share Posted August 24 Any update? Is there anything wrong with my code? Is this a bug? Can anyone provide a short C++ example for UniChart that works in C++ Builder? Thanks in advance Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 24 Author Share Posted August 24 Sherzod Can you please confirm with which C++ Builder versions the UniChart component works? Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 24 Author Share Posted August 24 Sherzod I got it to work half way what I need. So at least I know the UniChart component does work with C++ Builder. When I manually add a LineSeries to the UniChart component, then the following code works: TUniChartSeries *LineSeries = UniChart1->SeriesList->Series[0] ; LineSeries->Parent = UniChart1; LineSeries->Clear(); But I want to create Series[0] dynamically at run time. How do I do that? Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 25 Author Share Posted August 25 I figured it out, thanks to The following C++ code works and creates a LineSeries and AreaSeries dynamically, exactly what I want: int I; TUniLineSeries *LineSeries; TUniAreaSeries *AreaSeries; LineSeries = new TUniLineSeries(UniChart1); LineSeries->Name = "NewLineSeries"; LineSeries->Parent = UniChart1; for (I=1; I<=25; I++) LineSeries->Add(Random(1000), IntToStr(I)); AreaSeries = new TUniAreaSeries(UniChart1); AreaSeries->Name = "NewAreaSeries"; AreaSeries->Parent = UniChart1; for (I=1; I<=25; I++) AreaSeries->Add(Random(1000), IntToStr(I)); 1 Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 25 Author Share Posted August 25 Sherzod I spoke to soon. When I put the code above in the UniFormCreate event, then everything works perfectly. But when I move the exact same code to a UniButton1Click event, then nothing happens on the UniChart. This is very weird? void __fastcall TForm1::UniButton1Click(TObject *Sender) { // Same code don't work here } Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 25 Author Share Posted August 25 This seems to be a bug. No matter what I do, the same code that works perfectly in the UniformCreate event, does not work when inside a UniButton1Click event. I have found the following workaround: I create 2 UniCharts, same size and on top of each other. For the first chart I manually create a LineSeries and for the second chart I manually create an AreaSeries. Then at run time, depending on which button is pressed, I make UniChart1->Visible = true, UniChart2->Visible = false, and vice versa as needed. Its a clumsy approach, but the only code that works with uniGUI 1.90 Build 1535 to allow me to choose at run time between different Series types for a UniChart. Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 26 Author Share Posted August 26 Fore some reason my posts have been ignored for 3 days. What's going on? Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 26 Author Share Posted August 26 Sherzod I'm not a trial user, I've purchased a Complete Professional version in 2020, you can check my account Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 26 Share Posted August 26 Hello I'm sorry, you're not on ignore. Yes, I know you are a subscriber. I reported your issue. We will let you know. Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 26 Author Share Posted August 26 Thanks Sherzod Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 26 Author Share Posted August 26 Sherzod Can you please confirm that setting the Title for a Bar/Line/AreaSeries during run time has been implemented or not? e.g. BarSeries->Title = "2020"; In uniGUI 1.90 Build 1535, this is a protected member and the above line does not compile? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 27 Share Posted August 27 @Woutero You can try this approach for now: Quote Link to comment Share on other sites More sharing options...
Woutero Posted August 27 Author Share Posted August 27 Thanks it works 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.