in google chart legend lable in mobile responsive legend is slider ,I need to not silder legend but legend wordwrap.
var options = {
legend: {position:"bottom" , alignment: 'top'},
vAxis: {
viewWindowMode:'explicit',
viewWindow: {
max:<?=$target?>,
min:0
}
},
seriesType: 'bars',
series: {3: {type: 'area'}},
colors: ['CornflowerBlue', 'green', 'red', '#0099c6']
};
only available option is legend.maxLines...
Set this to a number greater than one to add lines to your legend. Note: this option currently works only when legend.position is 'top'.
with...
legend.position: 'top'
Related
How to use two different versions of chart.js in the same HTML file.
I want to have two different graphs from chart.js in one file, but they seem to be overlapping on top of each other. How can I have them both separately?
I have tried using div tags to have them on different parts of the page.
This could happen if you have used the same "id" for both canvases. You could try something like this:
<h1>
Chart 1
</h1>
<div>
<canvas id="chart1"></canvas>
</div>
<h1>
Chart 2
</h1>
<div>
<canvas id="chart2"></canvas>
</div>
The code for the charts - note how the first chart uses "chart1" and the second chart uses "chart2". If both charts use "chart1" then the second chart will be drawn on top of the first chart in the same canvas.
new Chart(document.getElementById('chart1'), {
type: 'line',
options: {
responsive: true,
},
data: {
label: [2000, 2001, 2002, 2003, 2004],
datasets: [{
label: 'First Dataset1',
data: [61, 44, 35, 33, 29]
}]
}
});
new Chart(document.getElementById('chart2'), {
type: 'bar',
options: {
responsive: true,
},
data: {
labels: [2006, 2007, 2008, 2009, 2010],
datasets: [{
label: 'Second Dataset',
data: [19, 17, 16, 13, 9]
}]
}
});
Link to working example: https://jsfiddle.net/hdahle/vtnc49pq/
I have a ui grid in which i am using pagination.
paginationSizes : [25, 50, 75 ,100]
On selecting 100 in the ui-grid dropdownlist, 100 doesnot gets diplayed fully.
How do i use CSS to change the the width of the shown dropdownlist.
Thanks :)
This is currently my grid options :
`$scope.gridOptions = {
enableFiltering: true,
enablePaging: true,
enableRowSelection: true,
multiSelect: false,
paginationPageSizes: [25, 50, 100],
paginationPageSize: 10
};`
Screenshot of my ui-grid dropdownlist
Set following CSS style property in your custom css file
.ui-grid-pager-row-count-picker select
{
width: 100px !important;
}
I am using ExtJs 4.2
My app needs to a have a button that will invoke a panel, that holds the navigation tree show once clicked.
This button needs to be visible at all times, and centered vertical to the middle and to the right of the screen.
How do I achieve this behavior? I don't want to nest the button in a panel, it should be a part of the view port...
Here is what I have tried:
Ext.define('NG.view.Viewport', {
extend: 'Ext.container.Viewport',
layout: 'border',
id: 'appviewport',
items: [{
itemId: 'app-header',
xtype: 'appheader',
region: 'north',
weight: 10,
border: false,
height: 60
}, {
itemId: 'navigation',
xtype: 'button',
region: 'west',
weight:15
}, {
xtype: 'carddeckmanager',
region: 'center',
weight:10,
border: false,
cls:'n-cardmanager-box',
items: [{
itemId: 'dashboard',
xtype: 'dashboard'
}]
}]
});
but this makes the button expand as the height of the viewport.
If you really want to float that button, there's no sense in adding it to a container or the viewport. Render it to the document body, configure it with floating: true, and give it a z-index that will ensure that it remains above any window (if that's what you want).
Then you can position it where you want with its alignTo method but, better yet, use anchorTo so that it sticks where you put it, even when the browser is resized.
All of this gives us:
var body = Ext.getBody();
// Create the button
var button = Ext.widget('button', {
text: "Yo"
,floating: true
,renderTo: body
});
// z-index
// Ext4's windows default z-index starts from 29000
button.setZIndex(40000);
// Anchor the right of the button to the right of the document body
// with a 5px horizontal offset.
button.anchorTo(body, 'r-r', [-5, 0]);
Put this code somewhere in the startup process of your application. Candidates could be the init method of your application, the initComponent method of your viewport, or a single afterrender listener on the viewport...
Now, if what you want is just that the button remains visible in the right border of the viewport but without it filling the whole region, you need to wrap it in a container with an appropriate layout. For example, add this to your viewport:
{
region: 'west',
layout: {type: 'hbox', pack: 'center', align: 'middle'},
items: [{
xtype: 'button',
text: "Viewport button"
}]
}
I have used google chart from this location
https://developers.google.com/chart/interactive/docs/gallery/linechart#Example
Is there any possibility to change the width and height of the legend icons i.e the blue and red rectangles.
As seen in the documentation:
legend: {position: 'top', textStyle: {color: 'blue', fontSize: 16}}
legend.textStyle: {color: <string>, fontName: <string>, fontSize: <number>}
Is it what you was looking for ?
I'm sure a lot of people use the twitter widget that twitter provides.
Here's the code they provide:
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 3,
interval: 6000,
width: 420,
height: 250,
theme: {
shell: {
background: '#ffffff',
color: '#000000'
},
tweets: {
background: '#ffffff',
color: '#000000',
links: '#666666'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'all'
}
}).render().setUser('apumpkinpatch').start();
</script>
You can see an example here how when you click the "feedback" tab on left side of screen, the twitter widget appears over the div. Any idea what I can do to prevent this?
I think the class for the widget is .twtr-doc according to the inspector. Anyone know if there is a css attribute I should be adding to it to stop this from happening?
EDIT -: took out IE part of question to just open it up in another question so I can mark the first answer as correct.
Re: the twitter widget being on top of the feedback div, you need to use z-index property in your styles to correct this.
Try adding z-index:100 to your feedback div. I do not have IE or I would help you debug that.