Skip to content

Commit

Permalink
Removed test graph
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejmets committed Oct 17, 2024
1 parent aaad523 commit dbe5e7c
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions src/senaite/timeseries/browser/templates/timeseries_results.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,6 @@
define="portal context/@@plone_portal_state/portal;"
i18n:domain="senaite.timeseries">

<!-- Load d3.js -->
<script src="https://d3js.org/d3.v4.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
loadLineChart();

function loadLineChart() {
const data = [
{ x: 1, y: 2 },
{ x: 2, y: 5 },
{ x: 3, y: 3 },
{ x: 4, y: 7 }
];

// Create SVG element
const svg = d3.select("#line-chart")
.append("svg")
.attr("width", 400)
.attr("height", 300)
.style("border", "1px solid black");

// Scales for x and y axes
const xScale = d3.scaleLinear()
.domain([1, 4])
.range([50, 350]);
const yScale = d3.scaleLinear()
.domain([0, 8])
.range([250, 50]);

// Line generator
const line = d3.line()
.x(d => xScale(d.x))
.y(d => yScale(d.y));

// Append line path to SVG
svg.append("path")
.datum(data)
.attr("d", line)
.attr("stroke", "steelblue")
.attr("stroke-width", 2)
.attr("fill", "none");

}
})
</script>

<!-- Results entry listing -->
<form name="listing_form"
class="form form-inline"
Expand Down Expand Up @@ -76,7 +30,4 @@
</div>
</form>

<!-- Create a div where the graph will take place -->
<div id="line-chart"></div>

</tal:contents_table>

0 comments on commit dbe5e7c

Please sign in to comment.