Vega-lite - remove selection when out of chart bounds - vega

Is it possible to cancel/empty a selection when the mouse is moved out of the chart area?
You can see an example of this "issue" on the official example here: https://vega.github.io/vega-lite/examples/interactive_multi_line_label.html
When the page first loads, the ruler and data point marks are not visible:
Hovering over the chart and then moving the mouse away from the chart results in:
Is it possible for the chart to be returned to it's default state when the mouse is moved away from the chart?

Yes. Add the clear property to the label marker, as below:
"selection": {
"label": {
"type": "single",
"nearest": true,
"on": "mouseover",
"encodings": [
"x"
],
"clear": "mouseout",
"empty": "none"
}

Related

apexcharts bar chart selection shading on click

I am looking to disable or at least find how to modify Apexchart's bar chart "selection shader" when you click on a bar chart. you can see in the image that the bar selected will turn darker than the rest. i want to build on this (make it darker or lighter).. I searched through the ApexCharts documentation and tried implementing selection and a few others, but no luck:
options = {
states: {
active: {
filter: {
type: 'none' /* none, lighten, darken */
}
}
}
}
Docs: https://apexcharts.com/docs/options/states/#active

Change the width of text input in a Kendo UI grid with InCell editing

Basically, I have a kendo UI gri with InCell editing. This is what it looks like.
This is what it looks like when I edit a cell.
And this is what I want it to look like.
I don't even know if that's possible, but it's on my requirements list. Any ideas?
Yes You Can , Use the editor property
columns: [
{
field: "Your Field",
title: "Your Field Name",
width: "20%",
editor: function (container, options) {
$('<textarea data-bind="value: ' + options.field + '"></textarea>').appendTo(container);
}
},
as the Text area behaviour you can drag right and bottom to disable dag to bottom use below css
textarea {
min-height: 75px;
resize: vertical !important;
}

Bad flot canvas chart size within Bootstrap tab pane on initial page load

I am building a Rails 3.2.11 app with Twitter Bootstrap and Flot (also HAML and Coffeescript).
In a view, I have Bootstrap tabs implemented like so (partials are rendered in the tab panes.),
.tabbable
%ul.nav.nav-tabs
%li.active
%a{'data-toggle' => 'tab', :href => '#tab1'} This is tab 1
%li
%a{"data-toggle" => "tab", :href => "#tab2"} This is tab 2
.tab-content
#tab1.tab-pane.active
= render 'tab_one_content'
#tab2.tab-pane
= render 'tab_two_content'
Within a partial, I have a table. I want to render a flot chart within a td. My partial where I want to render the chart looks something like this,
%table
%tr
%th
Some heading text…
%td
-# Make the 12-month barchart
- #chart_data = #barchart_12_mos_array.to_json
#my_barchart.barchart{:data => {:bardata => #chart_data}}
I am applying the chart dimensions with a CSS class like this,
.barchart {
width: 240px;
height: 120px;
}
My Coffeescript looks like this. I expect the chart to plot on document.ready
$ ->
$.plot $('#my_barchart'), [
data: $("#my_barchart").data("bardata")
bars:
show: true
barWidth: (365/12)*24*60*60*1000*.75
align: 'center'
],
xaxis:
mode: "time"
timeformat: "%b"
monthNames: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]
yaxis:
position: 'right'
I have confirmed this .js is loading.
The Problem:
When the DOM initially loads, the chart renders, but it is the wrong size. The chart area (where the bars are only) is as set with the .barchart CSS, but the axes labels, etc. are outside that dimension (see http://i36.tinypic.com/2vte1rp.jpg, red dashes are border of td).
Upon refresh (I have .js that refreshes to the previously selected tab), the chart renders in the correct size I want (i.e., the axes labels are inside the dimension, see http://i38.tinypic.com/4qq15g.jpg ).
I think I have to get the correct placeholder dimensions to Flot, but don't know how. Adding width/height CSS to the td does not fix the problem. Any ideas?
It sounds like the placeholder is within an element that starts out hidden. jQuery has trouble obtaining dimensions of hidden elements, which is a common cause of mis-sized plots. If that's the case, try showing the element before calling $.plot (you can position it absolutely, offscreen, to avoid any flickering), then reset it afterwards.

Link in Label BlackBerry 10

I am using JSON to receive data and place it into List. There is a Label displaying the text that I am receiving from the JSON. In some of the cases there is a Link in the text. By default you can't click on the Link from the label. Is there a way to make the Link to be clickable?
Label {
text: "Click here to open browser and get redirected to www.stackoverflow.com";
}
The output is "Click here to open browser and get redirected to www.stackoverflow.com" but the Link to StackOverflow is not clickable.
Use TextArea instead of Label and set property editable to false, it would look same as Label.
Don't forget to set inputMode to either Text or Chat.
TextArea {
text: "http://www.google.com"
editable: false
inputMode: TextAreaInputMode.Text
}
You can actually use HTML in the label itself to style the text as a link, according to the Text Styles documentation. You need to be aware of a few quirks though if you are going to apply any of your own styles, as discussed on the Blackberry Developer support forums here. The example below should work, using the default style which will colour the link blue, with bold and underline:
Label {
text: "<html>Click here to open browser and get redirected to <a href='http://www.stackoverflow.com'>www.stackoverflow.com</a></html>"
}
Note: you may need to set multiline: true on the Label in order to see all of the text, depending on your layout.
You should assign Text.RichText value to "textFormat" property of the Label:
import QtQuick 1.1
Rectangle {
width: 360
height: 360
Text {
text: "Click here"
anchors.centerIn: parent
textFormat: Text.RichText
onLinkActivated: {
Qt.openUrlExternally(link)
}
}
}

Sencha Touch Use Icon With Selectlist In Toolbar

I would like to use a selectlist in a toolbar but have a icon. For example someone wishes to select there radius for a places search around them I want to show an icon then when clicked allow the user to select different options ie (50meters, 1Kilometer, 10Kilometers).
Is there a better way to do this than a selectlist? Is this possioble with a select list in a tool bar? When I try to do it the selectlist shows the first value.
I trying to accomplish this with sencha touch.
You can just create two buttons over there : one with the label and another with the value. Then on both the buttons add one handler to open a floating panel showed by the second button.
Something like this:
{
xtype : 'toolbar',
defaults : {
scope ; this,
handler : showDistanceList,
ui :'plain'
},
items : [{
text : 'Some label',
id : 'label_btn'
}, {
text : '5 km', //default 5 km
id : 'value_btn'
}]
}
function showDistanceList(btn){
var distanceListPanel = new Ext.Panel({
floating : true,
width : 200,
height : 300,
//items : someListComponent
});
distanceListPanel.showBy(btn);
// Set value button value here with the selected list value
// Ext.getCmp('value_btn').setValue('value of item selected from list');
}
For the buttons, you can use any icons or html elements.