Highcharts long labels - highcharts

I have a question about long labels in highcharts.
If you look at http://jsfiddle.net/xeHyB/ you can see there very long labels, what makes that long labels are visible and chart in very small - useless.
xAxis: {
categories: ['Bla bla bla label, bla bla Bla bla bla label, bla bla Bla bla bla label Bla bla bla label, bla ', 'Bla bla bla label, bla bla', 'Bla bla bla label, bla bla', 'Bla bla bla label Bla bla bla label, bla bla Bla bla bla label, bla bla, bla bla', 'Bla bla bla label, bla bla', 'Bla bla bla label, bla bla']
},
I would like that labels would be short and elipsis and chart would be bigger,but on the tooltip I would like to see entire label.
Is that even possible?
Best Reagrds Matej

You can use the label formatter function option to format the labels any way you want:
xAxis: {
categories: ['Bla bla bla label, bla bla Bla bla bla label, bla bla Bla bla bla label Bla bla bla label, bla ', 'Bla bla bla label, bla bla', 'Bla bla bla label, bla bla', 'Bla bla bla label Bla bla bla label, bla bla Bla bla bla label, bla bla, bla bla', 'Bla bla bla label, bla bla', 'Bla bla bla label, bla bla'],
labels:{
formatter: function(){
if (this.value.length > 10){
return this.value.substr(0,10) + "...";
}else{
return this.value;
}
}
}
},
Updated fiddle here.

Related

Add dynamic UILabel inside UITableview with Expend Collapse Cell with dynamic height

This is my response json Where I need to Add Attachments name and type dynamically (Without using storyboard), In case attachment count == 0 , attachment name/type view should not be shown
[{
"Name": "Name1",
"attachement": [{
"imagename": "Name 1",
"imagetype": "Png "
},
{
"imagename": "Name 2",
"imagetype": "Jpeg "
}
],
"DetailView": "This is sample detailview Example with very long information"
},
{
"Name": "Name1",
"attachement": [{
"imagename": "Test Image 1",
"imagetype": "Png "
}],
"DetailView": "This is sample detailview Example with very long information"
},
{
"Name": "Name1",
"attachement": [],
"DetailView": "This is sample detailview Example with very long information"
}
]
Here is how my view looks
Collapse case :
UITableview
--Cell
---- Name Label
Expend case after looping attachment to show on UILabel :
UITableview
--Cell
---- Name Label
---- DetailView Label
---- imagename": "Name 1"
---- imagename": "Name 2"
I am using this code to Show my Expend/collapse UITableview programatically

How to send email with csv file attachment in jenkinsfile (Groovy Script)?

please help me to attach and send csv file along with email in groovy script .
right now i have below code , when i was changed csv instead of zip , facing error like ,
no DSL method ,
pipeline {
agent any
stages {
stage('Testing') {
steps{
bat "del test.zip"
zip zipFile: 'test.zip', archive: false, dir: 'directory pattern as per your structure'
}
}
}
post {
failure {
emailext attachmentsPattern: 'test.zip', body: '''${SCRIPT, template="groovy-html.template"}''',
subject: "${env.JOB_NAME} - Build # ${env.BUILD_NUMBER} - Failed",
mimeType: 'text/html',to: "email id"
}
success {
emailext attachmentsPattern: 'test.zip', body: '''${SCRIPT, template="groovy-html.template"}''',
subject: "${env.JOB_NAME} - Build # ${env.BUILD_NUMBER} - Successful",
mimeType: 'text/html',to: "email id"
}
}
}

Getting 'null' as value from input step method in case of abort button click inside Jenkins pipeline for interactive input

pipeline {
agent any
stages {
stage("Approval") {
steps {
script {
// Get the input in environment variable 'cmnt'
env.cmnt = input(
message: 'Do you want to approve the pipeline?',
parameters: [
text(defaultValue: '',
description: 'Enter your comment...',
name: 'COMMENT')
])
}
}
}
}
post{
success{
emailext (
subject: "Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' is approved.",
body: """<p>APPROVER COMMENT: '${env.cmnt}'</p>""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
}
aborted{
emailext (
subject: "Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' is aborted by approver",
body: """<p>APPROVER COMMENT: '${env.cmnt}'</p>""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
}
}
}
For success/Proceed button click, I am able to print comment inside email body whereas getting null as value in case of abort button click by approver at the time of approving the pipeline.

How to send allure or html report as an attachment in the Jenkins email notifications

How to send allure or html report as an attachment in the Jenkins email notifications. This is example of the pipeline i am using in my Pipeline script in Jenkins. I have setup my email notifcations, however i want to get some sort of report in the email. Please note that providing a link is not enough because my tests are setup on a different machine with the reports.
pipeline {
agent any
stages {
stage('Test') {
steps {
sh 'echo "Fail!"; exit 1'
}
}
}
post {
always {
echo 'This will always run'
}
success {
echo 'This will run only if successful'
}
failure {
mail bcc: '', body: "<b>Example</b><br>Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "ERROR CI: Project name -> ${env.JOB_NAME}", to: "foo#foomail.com";
}
unstable {
echo 'This will run only if the run was marked as unstable'
}
changed {
echo 'This will run only if the state of the Pipeline has changed'
echo 'For example, if the Pipeline was previously failing but is now successful'
}
}
}
You should use emailext plugin not mail
failure {
emailext(
attachmentsPattern: "<path to report>",
body: '',
subject: "",
to: ""
)
}

why does createElement prevent the DOM from loading in react-rails?

I'm going through this tutorial, and was fine until I changed the Records component and added React.createElement RecordForm, handleNewRecord: #addRecord between two DOM renderings. Seems to interfere and prevent the DOM from rendering at all.
Here's the component:
#Records = React.createClass
getInitialState: ->
records: #props.data
getDefaultProps: ->
records: []
addRecord: (record) ->
records = #state.records.slice()
records.push record
#setState records: records
render: ->
React.DOM.div
className: 'records'
React.DOM.h2
className: 'title'
'Records'
React.createElement RecordForm, handleNewRecord: #addRecord
React.DOM.hr null
React.DOM.table
className: 'table table-bordered'
React.DOM.thead null,
React.DOM.tr null,
React.DOM.th null, 'Date'
React.DOM.th null, 'Title'
React.DOM.th null, 'Amount'
React.DOM.tbody null,
for record in #state.records
React.createElement Record, key: record.id, record: record
Console error says "Uncaught ReferenceError: RecordForm is not defined". Which, yes I do, and it's:
#RecordForm = React.createClass
bla bla bla bla
handleChange: (e) ->
name = e.target.name
#setState "#{ name }": e.target.value
handleSubmit: (e) ->
e.preventDefault()
$.post '', { record: #state }, (data) =>
#props.handleNewRecord data
#setState #getInitialState()
, 'JSON'
render: ->
React.DOM.form
bla bla bla bla
What gives?
Looks like I had an unintended space before handleChange. Adding newlines between each function solved it. >:/

Resources