Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-smith committed Nov 23, 2024
1 parent abe3a31 commit bbc981c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
10 changes: 10 additions & 0 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from pathlib import Path
import humanize

from icecream import ic

from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from django.views.decorators.vary import vary_on_cookie
Expand Down Expand Up @@ -2200,6 +2202,14 @@ def create_suggested_applied_controls(request, pk):
requirement_assessment.create_applied_controls_from_suggestions()
return Response(status=status.HTTP_200_OK)

@action(detail=True, methods=["get"], url_path="progress_ts")
def progress_ts(self, request, pk):
data = HistoricalMetric.objects.filter(
model="ComplianceAssessment", object_id=pk
)
ic(data)
return Response(status=status.HTTP_200_OK)


class RequirementAssessmentViewSet(BaseModelViewSet):
"""
Expand Down
22 changes: 8 additions & 14 deletions frontend/src/lib/components/Chart/TimeSeriesChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
// specify chart configuration item and data
var option = {
title: {
text: 'Assessment progress'
},
grid: { show: false },
tooltip: {
trigger: 'axis',
formatter: function (params) {
Expand All @@ -32,22 +30,23 @@
},
xAxis: {
type: 'time',
boundaryGap: false,
splitNumber: 3, // Approximate number of splits to show
splitNumber: 3,
axisPointer: {
snap: true
}
},
yAxis: {
type: 'value',
boundaryGap: [0, '30%']
boundaryGap: [0, '5%'],
splitLine: { show: false }
},
series: [
{
name: 'Requirements assessed',
type: 'line',
symbol: 'none',
areaStyle: {
opacity: 1,
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
Expand All @@ -62,13 +61,8 @@
smooth: true,
data: [
[new Date('2024-01-01'), 0],
[new Date('2024-01-02'), 1],
[new Date('2024-01-03'), 4],
[new Date('2024-02-15'), 23],
[new Date('2024-03-01'), 41],
[new Date('2024-03-03'), 51],
[new Date('2024-03-10'), 60],
[new Date('2024-04-03'), 51]
[new Date('2024-01-02'), 10],
[new Date('2024-01-03'), 14]
]
}
]
Expand Down

0 comments on commit bbc981c

Please sign in to comment.