How Do I Keep All Series Labels on a 3D chart - charts

Suppose that I have a list of 40 planets (OK some are from another solar system). Astronomers have counted the number of meteors hitting the planets from January to December. So I have 40 rows of 12 columns of data.
When I plot a 3D chart the planets are displayed on the depth axis, the months January to December are on the Category axis, and the number of meteors on the value axis.
But some of the planets are missing. It seems SpreadsheetGear or Excel is treating the planets like numbers.
How do make SpreadsheetGear display all planets on the depth axis?
PS. I reviewed all related Spreadsheetgear docs but I couldn't find how to do this and checked StackOverflow for related questions but didn't find any.
Thanks, CoolBreeze

I think I solved my own problem:
1) I increased the width of the chart when I called AddChart:
ChartObj = m_WorksheetObj.Shapes.AddChart(Left, Top, Width, Height).Chart
2) I set TackLabelSpacing = 1
Dim DepthAxis As IAxis = ChartObj.Axes(AxisType.Series)
DepthAxis.TickLabelSpacing = 1
I'm not sure if that is the best solution but it appears to work for me at the moment.
If I add more planets the labels will be closer together and it'll be harder to read the labels. I'll have to widen the chart some more to spread out the labels to make them easier to read.
I added numbers in front of the planet names so when I looked at the list of planets on the chart I could see 1-40 and I knew all planets were listed.

Related

How to sort pivot based on measure and create a stacked bar chart

I am trying to create a stacked bar chart between 2 dimensions (one being week, other is a string - more below) and 1 measure. I am new to Looker.
But in order to get the stacked bar chart I figure that I need to
Create a pivot
Transpose the data
Create stacked bar chart
I am stuck with step 2 and 3.
The above steps is what I have thought could help me arrive at the visualization I want but would appreciate if there is any other solution for this.
Scenario:
I have a digital marketing data with me, where I am trying to create a visualization on ‘Leads’ generated,
I have 2 dimensions, 1 measure
Lead Created Week - Week on which a lead was created
Reason2 - reason a lead was created or what reason attracted the user most
Leads - count of leads
I have plotted the below visualization where I have created a pivot of week with Reason2 and Lead count under it and have plotted it on a stacked bar chart (as below).
Where each bar is a Reason (X-axis) and each color is the Week dimension, leads (count of leads) is in the Y-axis
Even though this is help what would be helpful is having ‘Week’ on X-axis, ‘Leads’ (count of leads) on Y-axis and ‘Reasons2’ dimension as a legend.
There is also one catch i.e., there are more than 100 distinct values in ‘Reason2’ field but I need to pick on Top 10 Reasons (i.e., the reasons that generated the most leads), which in the above screenshot I have achieved by limiting the display rows to 10 as the measure was already sorted.
I tried to flip around the pivot by having reason in pivot and Week as dimension, but if now the pivot is sorted in alphabetical manner and not by value of measures (screenshot below), I need the top 10 reasons which most leads per week.
How do I achieve the desired visualization of having week on X-axis with leads on Yaxis but only the top 10 Reasons should be generated.

How to set name on X axis Using charts on Swift 4?

This is my inquiry (edited):
I try to plot a monthly graphic using Charts, but I face some difficulties to put the names of the months on the X axis. My default value is like in the next image:
default value
And after using the most upvoted answer from here, I got this
So after investing some hours with futile results I'd like to ask you if you know how to get a plot similar to this one, please. So to summarize:
Put the names of the months on the x axis (Vertical, not horizontal as in the figure)
Plot the months' names on the base of the graphic, not on the top as seen on the default value
Thanks in advance. If you need some of my code, I can share it with you.
Kind regards.
After playing around and with a better research, this is the answer to my questions:
//Give the value of the months to the x axis
barChart.xAxis.valueFormatter = IndexAxisValueFormatter(values:months)
barChart.xAxis.granularity = 1
//Position of the x axis, rotation of the labels on the x axis and show all the names of the months consecutively
barChart.xAxis.labelPosition = XAxis.LabelPosition.bottom
barChart.xAxis.labelRotationAngle = -90.0
barChart.xAxis.setLabelCount(counter, force: false)

Custom number format for y-axis on Chart

I have created a chart with 2 axes that acts as a panel chart (see image)
As a panel chart I only want to show the portions of the relevant y-axes to the chart next to them. For example, for the right-most y-axis I used a custom number format to exclude anything less than 0:
_(* #,##0_);_("";_(* 0??_);_(#_)
But for the left most y-axis, I'm stuck. I want to show -400 to positive 400. I've tried 2 different options, but neither is producing the desired effect.
[<0](#,##0);[>500000000]"";#,##0_)
[<0](#,##0);[<500000000]#,##0_);""
Here is the result I'm looking for:
I learned something new today (and a bit weird) regarding formats and chart axes
After some experimenting, this is what I ended up using:
[White][>500]_(#,##0_);(#,##0);0;
The odd part: When you change the Display Units of the axis (for me, millions), then the formatting no longer recognizes the original amount (500,000,000).
Once I figured that out, I was able to work out the solution.

How to set my column at the center of the chart with ShinobiCharts

I have this column chart that has 2 modes, monthly visualization and yearly visualization, the monthly visualization works just fine with many column, however, my yearly visualization is broken because i can't get the only column that appears to be on the center of the chart, it's always being set to the first point on my XAxis.
If I were using a NumberAxis it would be easy to solve, just set the column to the middle point (in this case, position 6 among the total of 12 months). However I'm using CategoryAxis, since it isn't ordered as NumberAxis is, I'm unable to use the same solution....
How can I achieve this result with a CategoryAxis ?
PS: No matter the SChartRange I set to this Axis, the column will always be set to the first position in the XAxis.
Found a way to achieve the result I wanted.
I've altered the range to be around the first dataPoint only, this way the column got placed in the middle of the chart without having to be the "middle dataPoint", being the ONLY dataPoint. The code goes into my sChart: dataPointAtIndex forSeriesAtIndex as follows
-(id<SChartData>)sChart:(ShinobiChart *)chart dataPointAtIndex:(int)dataIndex forSeriesAtIndex:(int)seriesIndex{
.
.
.
SChartNumberRange * numberRange;
if(isYearlyChart){
numberRange = [[SChartNumberRange alloc] initWithMinimum:[NSNumber numberWithFloat:-0.9]andMaximum:[NSNumber numberWithInt:(1)]];
}
The normal NumberRange I was using was from 1 through 13.
Hope this helps others with similar problems regarding this subject :)
PS: I'll mark this as the correct answer as soon as possible.

Sigmaplot: How to scale x-axis for correctly displaying boxplots

I want to display overlapping boxplots using Sigmaplot 12. When I choose the scale for the x-axis as linear then the boxes do indeed overlap but are much too thin. See figure below. Of course they should be much wider.
When I choose the scale of the x-axis to be "category", then the boxes have the right width, but are arranged along each single x-value.
I want the position as in figure 1 and the width as in figure 2. I tried to resize the box in figure 1 but when I choose 100% in "bar width" than it still looks like Figure 1.
many thanks!
okay, I found the answer myself. In Sigmaplot, there is often the need to prepare "style"-columns, for example if you want to color your barcharts, you need a column that holds the specific color names.
For my boxplot example I needed a column that has the values for "width". These had to be quite large (2000) in order to have an effect. Why ? I have no idea. First I thought it would be because of the latitude values and that the program interprets the point as "1.000"s, but when I changed to values without decimals, it didn´t get better.
Well, here is the result in color.
Have fun !