PowerBI Sorting numbers as text instead of numerically [SOLVED] - sorting

PowerBi community - help!
I have a heatmap of product failures based on product characteristics. Right now my matrix is sorting my rows incorrectly. Right now from top to bottom, it is reading 1000, 105, 110, 115, 120, 1200, 1250, 130... and I want it to be in the order of 105, 110, 115, 120, 130, 1000, 1200, 1250. I do have these values as "whole numbers" in my data table. But it seems like it is sorting them alphabetically. Thank you for any tips you have!
Product failure heatmap
Data table
edit: Solved - I had to unpivot my data at one point, and when I made my feild parameters I accidentally used my unpivoted data. Therefore, it was using my unpivoted data type of "text." I was able to re do my feild parameters using my original data - and this solved the issue.
Feild parameters unpivoted -> text
fixed heatmap

Related

How to display blob image in img tag in Vue.js application?

I saved the image to database in the following format:
data:image/png;base64,iVBORw0KGgoAAAANSUhEU...
When I get that image from database, I see in "Network" tab in "Response" section the following:
"planimetry": {
"type": "Buffer",
"data": [
100,
97,
116,
97,
58,
...
In Vue.js template I have:
<img
:src="sectionData.planimetry"
/>
The sectionData I'm getting as a prop, and planimetry is type of BLOB.
The issue is the image is not displayed that is: src="[object Object].
How to display the image?
The numbers 100, 97, 116, 97, 58 are just data: in ASCII. This suggests that the array is just the bytes of your original image format.
You could get back to the original format using something like this:
planimetry.data.map(b => String.fromCharCode(b)).join('')
This should be sufficient to use it as the src of an <img>.
I would expect this to be fixed on the server rather than in the UI if possible. If it were returning the raw bytes of the image then fair enough but data:image/png;base64 should really just be transferred as a string.

Ensure value labels are displayed

I want to keep value labels outside my amChart graph. The problem is that when value label value is over 9999 then I cant display it's all content.
In this example values should be:
25,000
20,000
15,000
10,000
5,000
First digit is missing. I am dealing with this only by setting panel's margin
"panelsSettings": {
"marginLeft": 40,
"marginRight": 20,
},
Is there any more convienient way to be sure that labels are fitting? hardcoding margin seems to be overkill.
This is my example chart: https://jsfiddle.net/29w35txy/1/
As I mentioned in the comments above, it seems that this issue is depending on the default Browser font.
So it is working in Chrome (left), but does not work in Firefox (right) for me:
Beside that you can prevent this by increasing marginLeft of your panelsSettings which you are already using:
"panelsSettings": {
"marginLeft": 60,
// ...
},
Here I forked you fiddle to show the result.

Query a Chart with C3.js

I created a simple pie chart with around 10 items (using C3.js and D3.js). Now, in a second visualization (a table) I want to know the colors of each of the items, to also represent them in the table.
Is it possible to query the chart to receive the item's name and color?
I know I can manually hardcode colors for items and just use the same colors. However, this is not applicable in my case, as the items in the pie chart vary greatly (and I don't know them yet, as it is dependent on the user), hence my question.
Quick look at the source code reveals that you are correct, it's a category10().
Further it retrieves them by a key of "data id", which appears to be the first "column" in it's data input format:
columns: [
['data1', 30, 200, 100, 400, 150, 250], //<-- data1 is id
['data2', 130, 340, 200, 500, 250, 350]
]
You can inspect which are used by:
> chart.internal.color('data1')
"#1f77b4"
> chart.internal.color('data2')
"#ff7f0e"

D3 stacked bars data structure

I have data that I want to visualize as a stacked bar chart (or whatever might be suitable):
{
"ep1": {
"avi": 29,
"mov": 17,
"mp3": 19
},
"ep2": {
"avi": 13,
"mp3": 49,
"mp4": 37,
"xyz": 5
},
...
}
However, looking at various D3 as well as NVD3 examples (e.g. http://bl.ocks.org/mbostock/3943967), I'm not sure how to transform my data - whose groups are not the same across different columns - into the required data structure.
I'd be grateful for a simple example.
If you write a method to normalize a bit your data (eventually setting the xyz attribute of your ep1 object to zero for example), you can use the stack layout offered by D3. You will need to change the data structure from an array of objects to an array of arrays (as explained here) with all 2nd dimensional arrays having the same length, hence the need to set xyz to zero in the example.

Magento - Filtering a category by size

Hi is see various code blocks for filtering catergories.
But i haven't seen anything for what i am looking for.
We gonna sell kidsclothing in our webshop.
Kidsclothing can be dived in 4 different size blocks (baby, toddler, enfant and kids) and each block has different sizes.
Like:
Size block - Sizes
Baby - 50, 56, 62, 68 and 74
Toddler - 80, 86, 92 and 98
Enfant - 104, 110, 116 and 122
Kids - 128, 134, 140, 146, 152, 158, 164, 170, 176
Now i put these the right sizes into the right categories (like baby).
But only when i have a product that spans multple size blocks there a more size visible than i would like to see ...
For example.
When i have a configurable product with the following sizes 56, 74, 86 and 98.
The sizes 86 and 98 shouldn't be visible in the baby size block ... and the 56 and 74 shouldn't be visible in the toddler size block.
Who can help me write a code for this?
I have magento 1.6.2 CE
You will have to split your configurable product for every age category.
So you will have more products (consider this as minus).
But from the other hand you will be able to
1. Set different images for child, toddler, enfant (shoes does look different for all of them)
2. Set different prices for every age category.
3. More possibilities on creating price rules.

Resources