BoxPlot Charting on Visual C++ - c++

I am working on a project that processes data and displays information using Boxplot Chart in Visual Studio 2010 using C/C++ language.
I found some examples on MSDN Microsoft documentation but it only includes sample codes in C# and Visual Basic, but I couldn't find examples in C/C++ language.
I tried to create a boxplot using this code
this->chart1->Series["dat"]->Points->AddY(10);
this->chart1->Series["dat"]->Points->AddY(5);
this->chart1->Series["dat"]->Points->AddY(7);
this->chart1->Series["dat"]->Points->AddY(4);
this->chart1->Series["dat"]->Points->AddY(8);
this->chart1->Series["dat"]->Points->AddY(6);
But instead of showing a single boxplot (as below)
---------
|
|
-----
| |
-----
| |
-----
|
|
---------
it displays 6 different whiskers
--- ---
| --- --- | ---
| | | --- | |
| | | | | |
--- --- --- --- --- ---
I tried to manipulate C++ instructions in order to create a code similar to the sample code within the MSDN documentation and insert data into the chart, so I tried this:
this->chart1->Series["dat"]->Points->AddY(10);
this->chart1->Series["dat"]->Points->AddY(5);
this->chart1->Series["dat"]->Points->AddY(7);
this->chart1->Series["dat"]->Points->AddY(4);
this->chart1->Series["dat"]->Points->AddY(8);
this->chart1->Series["dat"]->Points->AddY(6);
this->chart1->Series["BoxPlotSeries"]["BoxPlotSeries"]="dat";
But it didn't work.
It is kind of difficult for me to explore the Chart methods and properties as VS2010 does not provide Intellisense for C++/CLI.
Could you provide me any sample code to create Boxplot Charts for Visual C++ 2010??? Any ideas???
Thanks in advance.

System::Windows::Forms::DataVisualization::Charting::Series^ bpSeries =
gcnew System::Windows::Forms::DataVisualization::Charting::Series();
bpSeries->Name = "bpSeries";
std::vector<int> yValues { 10,5,7,4,8,6 };
for(int i = 0; i < yValues.size(); i++)
bpSeries->Points->AddY(yValues[i]);
this->chart1->Series["dat"]["BoxPlotSeries"] = "bpSeries";

Related

reference a markdown table in R markdown

My question is how to reference tables in markdown format like the following because the answer here doesn't work
Referencing a 'hand-made' table using bookdown package
I tried
---
output: html_document
---
you may refer to this table using \#ref(tab:foo)
Table: (\#tab:foo) Your table caption.
+-----------------------+-----------------------+-----------------------+
| Auteur | Protocole | Résultats |
+=======================+=======================+=======================+
| (Jiayi 2011) | Analyse formantique | Diphtongaison de [e |
+-----------------------+-----------------------+-----------------------+
and it didn't work.
it gives "Table : (#tab:foo) Your table caption." as the caption and "you may refer to this table using #ref(tab:foo)" If I cross reference using #ref(tab:foo).
Is it possible also to have automatic numbering ?
Looks like you just need to use bookdown's output formats.
---
output:
bookdown::html_document2:
df_print: paged
---
you may refer to this table using \#ref(tab:foo)
Table: (\#tab:foo) Your table caption.
+-----------------------+-----------------------+-----------------------+
| Auteur | Protocole | Résultats |
+=======================+=======================+=======================+
| (Jiayi 2011) | Analyse formantique | Diphtongaison de [e |
+-----------------------+-----------------------+-----------------------+
The answer here works for me:
I am joining the discussion a bit late, but I just wanted to share a working MWE (based on the earlier answers):
```{r , echo=FALSE, results='asis'}
cat(' Table: (\\#tab:mwe) Example
| Sepal.Length| Sepal.Width| Petal.Length|
|------------:|-----------:|------------:|
| 5.1| 3.5| 1.4|
| 4.9| 3.0| 1.4|
| 4.7| 3.2| 1.3|
| 4.6| 3.1| 1.5|')```
The table can now be reference via \#ref(tab:mwe) in bookdown. This is working for me in pdf and html exports.
Note that if you would like to add greek letters or more complicated sub-or superscripts, you will need to include the following text reference outside of the code chunk
(ref:flower) Flower~dimensions\ example~
```{r , echo=FALSE, results='asis'}
cat(' Table: (\\#tab:mwe) Example with (ref:flower)
| Sepal.Length| Sepal.Width| Petal.Length|
|------------:|-----------:|------------:|
| 5.1| 3.5| 1.4|
| 4.9| 3.0| 1.4|
| 4.7| 3.2| 1.3|
| 4.6| 3.1| 1.5|')```

How do I find change point in a timeseries in PoweBi

I have a group of people who started receiving a specific type of social benefit called benefitA, I am interested in knowing what(if any) social benefits the people in the group might have received immediately before they started receiving BenefitA.
My optimal result would be a table with the number people who was receiving respectively BenefitB, BenefitC and not receiving any benefit “BenefitNon” immediately before they started receiving BenefitA.
My data is organized as a relation database with a Facttabel containing an ID for each person in my data and several dimension tables connected to the facttabel. The important ones here at DimDreamYdelse(showing type of benefit received), DimDreamTid(showing week and year). Here is an example of the raw data.
Data Example
I'm not sure how to approach this in PowerBi as I am fairly new to this program. Any advice is most welcome.
I have tried to solve the problem in SQL but as I need this as part of a running report i need to do it in PowerBi. This bit of code might however give some context to what I want to do.
USE FLISDATA_Beskaeftigelse;
SELECT dbo.FactDream.DimDreamTid , dbo.FactDream.DimDreamBenefit , dbo.DimDreamTid.Aar, dbo.DimDreamTid.UgeIAar, dbo.DimDreamBenefit.Benefit,
FROM dbo.FactDream INNER JOIN
dbo.DimDreamTid ON dbo.FactDream.DimDreamTid = dbo.DimDreamTid.DimDreamTidID INNER JOIN
dbo.DimDreamYdelse ON dbo.FactDream.DimDreamBenefit = dbo.DimDreamYdelse.DimDreamBenefitID
WHERE (dbo.DimDreamYdelse.Ydelse LIKE 'Benefit%') AND (dbo.DimDreamTid.Aar = '2019')
ORDER BY dbo.DimDreamTid.Aar, dbo.DimDreamTid.UgeIAar
I suggest to use PowerQuery to transform your table into more suitable form for your analysis. Things would be much easier if each row of the table represents the "change" of benefit plan like this.
| Person ID | Benefit From | Benefit To | Date |
|-----------|--------------|------------|------------|
| 15 | BenefitNon | BenefitA | 2019-07-01 |
| 15 | BenefitA | BenefitNon | 2019-12-01 |
| 17 | BenefitC | BenefitA | 2019-06-01 |
| 17 | BenefitA | BenefitB | 2019-08-01 |
| 17 | BenefitB | BenefitA | 2019-09-01 |
| ...
Then you can simply count the numbers by COUNTROWS(BenefitChanges) filtering/slicing with both Benefit From and Benefit To.

how to create a subcolumn inside a column in Gtk+ using C++

I am creating a listview with 5 columns in Gtk+ using C++. I was able to do that. But the problem is, I need subcolumns for the 2nd column which I'm not sure how to proceed.
firstcolumn | second column | third |
|SC1 | SC2 | SC3| |
| | | | |
Is this possible? Can you suggest how to go about it?

Executable Scenarios (BDD) for C++

Does anyone know of a BDD framework for C++ that allows the execution of (Gherkin) scenarios such as:
Feature: Table support in nbehave
Scenario: a table
Given a list of people:
|Name |Country|
|Morgan |Sweden |
|Jimmy |Sweden |
|Jimmy |USA |
When I search for people from Sweden
Then I should find:
|Name |Country|
|Morgan|Sweden |
|Jimmy |Sweden |
I've found a project called Cukebins: https://github.com/paoloambrosio/cukebins/wiki/Release-0.2. I haven't tried it and I don't know how well it works. Renamed to Cucumber-CPP and moved to https://github.com/cucumber/cucumber-cpp/
There's also a discussion with some alternatives here: http://groups.google.com/group/cukes/browse_thread/thread/1f496aba050a22c3/145b871678e2bbbc

C++ - basic Qt question

Do I have any simple way to have context menu items, that aren't highlighted when mouse goes over them (using Qt)?
I want to make simple context menu with various item groups such as
| Group1
| -----
| DoSomething
| DoSomethingWow
| DoSomethingCool
|
| Group2
| ------
| DoSomethingCoolHuh
and I want Group1 and Group2 act as simple labels so that users couldn't even focus them.
Is this possible?
simple solution which comes to my mind "out of the box" is to:
set those items disabled:
item.setEnable(False)
Then you could use some style to make it look different.
Hope this helps.