Add extra info to tooltip for specific bar in nvd3 multiBarChart - tooltip

I use django with django-nvd3 to generate some charts. I'am not good in javascript at all.
I have this example (java script was created by django-nvd3)
http://jsfiddle.net/rkorzen/87WVr/2/
I want to add extra info to tooltip (if this extra info exist for my bar).
Data is composed of the blocks:
{"values": [{"y": 19, "x": "Checkpoint 1", "info":"ABDG"},
{"y": 17, "x": "Checkpoint 2"}],
"key": "Very good", "yAxis": "1"
},
in this point I want to ad info "ABDG" to tooltip for bar x="Checkpoint 1" and y=19
But don't have idea how :(
I'am not sure if django-nvd3 have some options for this. So decided to ask about js.
Maybe someone Can help:)

Try using extra dict :
'chartdata': {
'x' : 'your_x_axis data',
'name1': 'Somename',
'y1': 'y_axis_data' ,
'extra1': {
"tooltip": {"y_start": "", "y_end": " cal"},
},
}

Related

Onchange update second subcomponent

I have a file that is used to store all my colour choice, I bring the colour choices that I need into a part file using the Subcomponents (Supersedings)
{
"internalId": "externalCubbyCoverColourRack",
"componentId": "racksystems_test:sub_mfccolours",
"numberInPartList": "0",
"active": "version=='Rack'",
"supersedings": [
{
"type": "parameter",
"key": "cubbyCoverColourRack"
}
]
}, {
"internalId": "externalCubbyColourRack",
"componentId": "racksystems_test:sub_mfccolours",
"numberInPartList": "0",
"active": "version=='Rack'",
"supersedings": [
{
"type": "parameter",
"key": "cubbyColourRack"
}
]
},
I have 2 colours that I bring in that are a Main Colour and a Cover Colour, when the main colour is selected it changes the Main Colour and I want it to change the Cover Colour too but if you change the Cover Colour only the cover colour changes. Is this possible to do with a KEY that's used from Subcomponents?
Normally, it is recommended to use parameter onValueChange script. However, this is intended to work in a scope of a single component.
From your code, I think it should be possible to supersede both of them from a single subComponent instance. Then you can link the two parameters somehow in the sub_mfccolours itself, using parameter onValueChange script.
It is important to know, that every subComponent instance is its own component with its own internal data. If you have a reason to have two subComponents like this, it might help to add assignment "cubbyColourRack": "cubbyColourRack" to the externalCubbyCoverColourRack subComponent.

Highmaps won't display my GeoJSON lake layer

I don't succeed in adding a final layer to my Highmaps. I have already the ground map and some additional layers. But the lake layer does not succeed to be displayed. Why is that? It does load into QGIS correctly.
Truth is, by the way, that I haven't understood the difference between calling a GeoJSON file like this (which works for my additional layers):
type: 'mapline',
data: Highcharts.geojson(Highcharts.maps['lakes'], 'mapline'),
or like this (which works for the ground layer):
mapData: Highcharts.maps['lakes'],
data : data,
But not sure if this is relevant here. It doesn't work the one or the other way. Here is a fiddle.
Thanks for any hints.
The problem is caused by one of the geometry which has null value:
{
"type": "Feature",
"geometry": null,
"properties": {
"OBJECTID": 13,
"NAME": "Lake St. Martin",
"Shape_Leng": 1.1857234063,
"Shape_Area": 0.0450760801303
}
}
After removing the incorrect item everything works as it should. As to your second question: please also check chart.map property: https://api.highcharts.com/highmaps/chart.map and a precise description here: https://www.highcharts.com/forum/viewtopic.php?t=39602
Live demo: https://jsfiddle.net/BlackLabel/ga396zwo/
Docs: https://www.highcharts.com/docs/maps/custom-geojson-maps
API Reference:
https://api.highcharts.com/class-reference/Highcharts#.geojson
https://api.highcharts.com/highmaps/series.mapline.mapData
https://api.highcharts.com/highmaps/series.mapline.data

How to create a composite caption on Neo4j Grass style file?

For example,
"node.Person": {
"color": "#FF756E",
"border-color": "#E06760",
"text-color-internal": "#FFFFFF",
"caption": "{name}"
}
I want the "Person" to be displayed as the label of the node, and "name" and "age" to be displayed as the attributes of the node. Currently, only 'name' is displayed as the caption.
How to change the code above?
EDITED:
Neo4j people, how did you generate the graphs in the book? Thank you. This is one example below.
You can do it by editing the styles. Do this by typing ":style" to the neo browser UI, copy-paste the styles to text editor and just add the fields to the caption in curly brackets e.g.
"node.Person": {
"defaultCaption": "<id>",
"diameter": "50px",
"color": "#A5ABB6",
"border-color": "#9AA1AC",
"text-color-internal": "#FFFFFF",
"caption": "{name} {age}"
}
Would result in showing Person entities with name and age on them.
As I said in the comments of my answer its not possible. My anwser is as close as you can get. "node.MESSAGE": { "caption":"Message name:{NAME}" }. You can only write directly onto the node. I recommend to use different colours for different labels

Umbraco - Add spacing under element

The question might seem stupid. but i really can't find what i should type on the "Add spacing under element" text box to achieve the spacing from the CMS and not hard-coded.
In an element properties you can see this window:
Umbraco version 7.2.5 assembly: 1.0.5610.18894
Free License for now but planning to get one this week.
Okay I got your point. You are using Grid Layout.
By default Umbraco Grid layout datatype have setting class and styling background image as below
This can be found in Developer -> Datatypes - > datatype you have created with "Grid Layout", You can find data type name in Setting->Document types -> Name of home doc type -> generic properties
You can change settings and styles by clicking edit, it contains json data as below. This is default value
For setting
[
{
"label": "Class",
"description": "Set a css class",
"key": "class",
"view": "textstring"
}
]
For Style
[
{
"label": "Set a background image",
"description": "Set a row background",
"key": "background-image",
"view": "imagepicker",
"modifier": "url({0})"
}
]
Get full details on link
Now your scenario.
I think according to description, you have used this to add padding-bottom or margin-bottom style on the element. So you must use values like "20px" or "10px". Try only numbers like "10" if this don't work

Sublime Text 2 up/down arrow movement keybinding

when i have one line of text on sublime text 2, say I have the line "test".
if the caret is between 'e' and 's' and I press the up button, it doesn't do anything.
I would like to change that, so if there is no line above the current one, when I press up, the caret should go to the start of the line.
same with down button.
if there is no line between the current line, the caret should move to the end of the line.
that is the default textmate behavior, and I use it a lot.
can I change that on sublime text 2 with keybindings?
I know it should be something like this:
{ "keys": ["up"], "command": "move", "args": {"by": "characters", "forward": false }, "context":
[
{ "key": "something", "operator": "not_regex_contains", "operand": "\n" }
] }
I cannot find the right context for it. I tried preceding_text not_regex_contains "\n", but preceding_text only returns the text between the start of the current line and the caret.
any ideas?
thank you.
This should work as you'd expect in latest dev builds - http://www.sublimetext.com/dev.
You don't need a keybind to accomplish this. Adding the following line in your Preferences.sublime-settings file should do the trick:
"move_to_limit_on_up_down": true,
The reason for the terminating comma is because these files are in json, and if you have entries after this one, you'll need to separate them by comma. For reference, here's my Preferences.sublime-settings file as an example:
{
"always_show_minimap_viewport": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"font_size": 12,
"highlight_line": true,
"highlight_modified_tabs": true,
"move_to_limit_on_up_down": true,
"overlay_scroll_bars": "enabled",
"show_tab_close_buttons": false,
"tab_completion": false
}
You can edit this file by going to Preferences > Settings - User in Sublime.

Resources