How to change color of x and y axis

27 views
Skip to first unread message

Marco Craamer

unread,
Jan 29, 2018, 10:39:32 AM1/29/18
to d3-js
Hi All!

Yes been working on this problem for about 3 days... Can't find it...

My question is simple, I have a black background on my website and I want to place a chart on it... So the x and y axis do need to have a different color (green or so), does anyone know how to do this?

I can't find it...

Thank you very much!

Marco

Jean Mercier

unread,
Jan 29, 2018, 10:52:32 AM1/29/18
to d3...@googlegroups.com
You can change it in the css:

you probably have something like

.axis path,
.axis line {
  fill: none;
  stroke: #000;
  shape-rendering: crispEdges;
}
Just change the stroke color

--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marco Craamer

unread,
Jan 29, 2018, 12:57:11 PM1/29/18
to d3-js
Thank you very much for your reply... Unfortunately I can't get it to work... 

This is my code:


.chartContainer .axis path,
.axis line {
  fill: none;
  stroke: #3333;
  shape-rendering: crispEdges;
}

<div class="chartContainer">
<script type="text/javascript">

function createChart(data) {
var svg = dimple.newSvg(".chartContainer", 800, 600); // 590,400

var myChart = new dimple.chart(svg, data);
myChart.setBounds(70, 40, 700, 500) // 70,40,490,320

var x = myChart.addTimeAxis("x", "date", "%d/%m/%Y", "%d/%m/%Y");
var y = myChart.addTimeAxis("y", "time","%H:%M", "%H:%M");
var parseTime = d3.timeParse("%H:%M:%S");
y.overrideMin = parseTime("06:00:00");
y.overrideMax = parseTime("21:00:00");

var s = myChart.addSeries("mode", dimple.plot.line);
s.interpolation = "cardinal";
s.lineMarkers = true;

myChart.addLegend(180, 10, 360, 20, "right");
myChart.draw();
}
</script>
</div>

Is there someone else which can help me?

It seems so simple, just change the color of the X and Y axis... but I can't find it... really frustrating!

Thanks!

Marco


Op maandag 29 januari 2018 16:52:32 UTC+1 schreef jeanmercier:
You can change it in the css:

you probably have something like

.axis path,
.axis line {
  fill: none;
  stroke: #000;
  shape-rendering: crispEdges;
}
Just change the stroke color
2018-01-29 16:39 GMT+01:00 Marco Craamer <marco....@gmail.com>:
Hi All!

Yes been working on this problem for about 3 days... Can't find it...

My question is simple, I have a black background on my website and I want to place a chart on it... So the x and y axis do need to have a different color (green or so), does anyone know how to do this?

I can't find it...

Thank you very much!

Marco

--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.

sandeep edara

unread,
Jan 31, 2018, 4:21:41 AM1/31/18
to d3-js
Hi Marco,

Since you are using dimplejs.
The class assigned is dimple-custom-axis-line to the path for the axis.

change the stroke property for this class.

Regards,
Sandeep.
Reply all
Reply to author
Forward
0 new messages