Show quantity and percent values on Chart - asp.net

I everyone;
I'm working with a ASP NET Chart and I have one Column Chart. In this chart I want to show the values of percent and quantity like '10% (100)'.
I did it and it's working, but the column is shown based on percent value but I want to base it on quantity value.
This is my code:
Series mainSeries = new Series(serieName);
mainSeries.XValueMember = "ANSWER";
mainSeries.YValueMembers = "Total";
mainSeries.Label = "#PERCENT" + "\n(#VALY)";
This is the problem. I want that the size of the column is shown based in percent value and in this way the column size is based on quantity value.
If I change the YValueMembers by "Percent" when I have quantity equal 100 and percent equal 10, the value is shown like '10% (10)', I mean...just the percent value is shown.
That is my chart, I would like to show the column based in 50% not in 1 (quantity).
Any idea about how can I do it?

I am not sure, but this can help
Chart.Series[0].Points.DataBind(dv, "PKProject", "TotalSale", "LegendText=ProjectLabel");
ChartSalesPerProject.Series[0].Label = "#PERCENT{P0}";

Related

Kusto - Add percentage symbol to the result

I have a Kusto Query to calculate a percentage value.
for example percentage = 100 * online / total
then I output the result with | project perc
But I could not add the percentage symbol to the values in the table. COuld you please suggest how to resolve for example the value should be 100% instead of just 100
Thanks
You can use the strcat() function.
For example: print p = strcat(100, "%")

PowerBI - Count of days where the sum of a column for that date is above 0.5

I'm having some trouble figuring out how to put some data on a visualization.
I want a bar chart that has a list of computer labs on the x axis, and the "count of days where the sum of Util4 for that date is above 0.5 on the y axis
Some of the formulas for measures i've tried are:
High Util = COUNTAX('Login Sessions', SUM('Login Sessions'[Util4]) >0.5) doesn't work
High Util2 = COUNTROWS(FILTER('Login Sessions', 'Login Sessions'[Util4] >0.5)) only counts lines where Util4 is above 0.5, doesn't sum to find dates where multiple rows for this date add up to above 0.5
I'm missing some math know how here, I know i need to incorporate StartDate into my measure somehow, but not sure how. Any advice would be appreciated.
edit: In my dataset i have unique 289 dates. Each row is a login session that happened on a computer in a computer lab. I want to sum all of the Util4 numbers for that specific date\computer lab combination and then count how many times each computer lab had that sum be above 0.5. I do not know the proper way to do this.
My expectation would be numbers between 0 and 289 for each computer lab, which i could then make a visualization to show which rooms had util4 above 0.5 (50%) the most often.
Following will get you the sum of Util4 for each day/lab, add it as calculated column in your table:
Total Util =
VAR _Date = SELECTEDVALUE('Login Sessions'[StartDate])
VAR _Lab = SELECTEDVALUE('Login Sessions'[Ad Computers.Computer Lab])
RETURN
CALCULATE(
SUM('Login Sessions'[Util4]),
FILTER(
ALL('Login Sessions'),
'Login Sessions'[StartDate] = _Date &&
'Login Sessions'[Ad Computers.Computer Lab] = _Lab
)
)
Then create the following measure for the count:
_daysCount =
CALCULATE(
DISTINCTCOUNT('Login Sessions'[StartDate]),
FILTER(
ALL('Login Sessions'),
'Login Sessions'[Total Util] >0.5
)
)

explicit the x-value for plotting in gnuplot

In GNUPLOT, I would like to plot 5 values on a single bar chart, separated with some spacing in between. If I have data formatted as such:
3342336, 3375103, 7110653, 32770, 0
where those 5 values are the y-values, how can I specify the x-values myself for where they should belong?
For example, I would like my bar chart to have each entry be of length 1,
so I plot y-value 3342336 at x-value 1,
y-value 3375103 at x-value 3,
y-value 7110653 at x-value 5,
y-value 32770 at x-value 7,
and y-value 0 at x-value 9.
I would appreciate any example code that can achieve this. Thanks.
If your data is in one row as shown, you can achieve this by using the plot for syntax looping over the column index, and calculating the x value from that index. We can grab the column by using the column function which retrieves the specified column number.
set boxwidth 1
set datafile separator comma # only if data is comma separated
plot for [i=1:5] (2*i-1):(column(i)) with boxes
If we need to ensure the same line type is used each time, we can explicitly state it in the plot command.
plot for [i=1:5] (2*i-1):(column(i)) with boxes lt 1
Additionally, if a key is to be generated, and we don't wish each plot statement to generate one, we can test for and only give a nonempty title on the first iteration (an empty title is treated the same as no title).
plot for [i=1:5] (2*i-1):(column(i)) with boxes lt 1 title (i==1)?"Title":""
If your data is separated into rows as is the normal format, this can be obtained a different way.
Gnuplot has several pseuduocolumns (see help pseudocolumns for details). In your case, column 0 is of interest. Column 0 gives the line number of the data starting at 0. Thus to get sequential odd numbers like that, you can use 2*$0+1.
For example, if your data (stored in datafile.txt) looks like
3342336
3375103
7110653
32770
0
and you wish to plot boxes of length 1 at those values, you can do
set boxwidth 1
plot "datafile.txt" u (2*$0+1):1 with boxes

Count of {field.name} where {field.name} = "No"

Good day; I am looking for help creating a running total or a formula where I can see a count of a specific field that equals "No".
Currently I have a total count of {ems_SceneCall.CrewDecison} for all decisions, and now I want to add a count of {ems_SceneCall.CrewDecison} = "No". I have had success with this up to the point where I want to count to reset with each group.
Currently I have a Running Total Set to count the field, Evaluate records where {ems_SceneCall.CrewDecison} = "No", and reset on change of group. This running total only shows 1 or 0.
Another way to do this is a formula that says
if {ems_SceneCall.CrewDecison} = "No" then 1 else 0
Then create a group summary (SUM) to the group footers

How to get count of repeated values in datatable in asp.net

I want total count of repeated values in a datable.
as shown in image total count should be : 2 because repeated values are only 1 and 2.
I tried as given below:
DataView dv = new DataView(dtTemp);
int iRowCount = dv.ToTable(true, "Column1").Rows.Count;
but it returns 3 which is incorrect.
Does anyone knows how to do it.
I don't want to use loop becoz sometimes data table contains 4000-5000 rows so if we use loop it will take much more time to get the total count.
Thanks.

Resources